开发者

calling viewDidLoad after some delay

The scenario is as follows:

My application has a tabBarController on tapping a tab there occurs some parsing of XML from server which takes some time.The data recovered from parsing is gonna be there on the view of the selected viewController(i.e; the data is used in the viewDidLoad method).Now how can I ensure that the viewDidLoad method is called only when the parsing has been completed. Parsing is done in some delegate methods of the NS开发者_C百科URLConnection class which gets called after some time the connection has established.In the meantime the viewDidLoad method gets called.


why don't you move your code from viewDidLoad into a custom function and then call that when your XML has been parsed?

for instance I have some applications where blog feeds/rss/xml are loaded into a UITableViewController and on connectionDidFinish: I just call [tableView reloadData]; rather than trying to run viewDidLoad again.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜