How to send an Array from AppController to RootViewController
The appDelegate creates an MSMutableArray from some content downloaded from internet.
This array should be displayed in the RootViewController of the NavigationController ( a UITableView).
What's a correct workflow? Send a message to the RootViewController to reload the data 开发者_StackOverflowand pass the array from the appController to the RootViewController?
In the appDelegate:
[self.RootViewController loadArray: myArray];
In RootViewController:
-(void) loadArray: (NSArray *)theArray {
self.array = theArray;
[self.tableView reloadData];
}
In reverse you can make it as delegate, but you approach seems to be better.
精彩评论