I use original method XML data can show in rootviewcontroller TableView. When i use New Procedure it show the table only no data. How can i show the data in New Method?
Original Method
- appDelegate.m (setup XML & load the data)
- rootviewController.m (use nsarray & load the data into table view)
New Method
- appDelegate.m (setup XML & load the data)
- mainviewController.m (Setup up UIVEW & button key), (when button press, go to rootviewcontroller.m)
- rootviewController.m (use nsarray & load the data into table view)
appDeleagte.m
- (void)addbookToList:(NSArray *)books {
[self.rootViewController insertBooks:books];
mainviewcontroller.h
#import <UIKit/UIKit.h>
@class RootViewController;
@interface MainViewController : UIViewController {
IBOutlet RootViewController *rvController;
}
- (IBAction) startButton;
@end
mainviewcontroller.m
-(IBAction)startPage {
rvController = [[RootViewController alloc] initWithNibName:@"RootView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:rvController animated:YES];
rootviewcontroller.m
- (void)viewDidLoad {
[super viewDidLoad];
self.bookList = [NSMutableArray array];
self.tableView.rowHeight = 60.0;
[self addObserver:self forKeyPath:@"bookList" options:0 context:NULL];
}