我做错了吗? 我甚至尝试过viewDidAppear,同样的事情。有什么建议吗?
由于
编辑:我想清楚地说明我在做什么
1. i have a parent view, which has a scroll view - and a subview
2. In the parent view, i create multiple instances of the subview and add them to the scrollview, creating scrollable views, which work.
3. Each view is passed an argument and depending on the argument the view contents change - works as expected.
4. I would like to show the subview and once its on the screen, do some internet opearations while i show an activity indicator, for this i need to use viewDidApper.
5. I am manually firing the subview's viewDidAppear from the parent view, once i have created its instance
这里的问题是,只有在所有操作完成后才会出现视图。
我该如何对此进行排序?
答案 0 :(得分:5)
viewWillAppear
应该在视图出现之前触发,因此名称中的单词将。您可能对viewDidAppear
感兴趣。
答案 1 :(得分:1)
我想我想出来了 - 我没有在viewDidAppear上执行操作,而是使用了performSelector,类似这样的
-(void) viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self performSelector:@selector(loadXML:) withObject: self afterDelay:0];
}
谢谢你们!