开发者

How to send an Array from AppController to RootViewController

开发者 https://www.devze.com 2023-04-10 05:08 出处:网络
The appDelegate creates an MSMutableArray from some content downloaded from internet. This array should be displayed in the RootViewController of the NavigationController ( a UITableView).

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

精彩评论

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