开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜