在我第一次加载时,一切都很好。这是我的 NSlog
2013-03-07 09:15:57.289 SAMPLE[10566:207] -->Starting viewDidLoad
2013-03-07 09:15:57.775 SAMPLE[10566:207] -->Starting viewDidAppear
2013-03-07 09:15:58.518 SAMPLE[10566:207] all done!
2013-03-07 09:15:58.518 SAMPLE[10566:207] stories array has 4 items
2013-03-07 09:15:58.527 SAMPLE[10566:207] -->Starting CellForRowAtIndex
但是,当我单击导航中的后退按钮并再次单击视图时,它会挂起,直到填充单元格。请参阅下面的 NSlog
2013-03-07 09:16:06.252 SAMPLE[10566:207] -->Starting viewDidLoad
2013-03-07 09:16:06.309 SAMPLE[10566:207] -->Starting CellForRowAtIndex
2013-03-07 09:16:07.019 SAMPLE[10566:207] -->Starting CellForRowAtIndex
2013-03-07 09:16:07.679 SAMPLE[10566:207] -->Starting CellForRowAtIndex
2013-03-07 09:16:08.198 SAMPLE[10566:207] -->Starting CellForRowAtIndex
2013-03-07 09:16:09.242 SAMPLE[10566:207] -->Starting viewDidAppear
我的 viewDidAppear 有以下内容。
- (void)viewDidAppear:(BOOL)animated {
NSLog(@"-->Starting viewDidAppear");
[super viewDidAppear:animated];
if ([[xmlParser branch] count] == 0) {
[self loadDatafromServer]; // Goes and runs my XML Parser and fill the array.
}
[self loadBranchs]; // This just loads my annotations for my map
[self.tableView reloadData];
}
这里有任何想法。正如我所说,她第一次加载完美,但如果用户返回并进入它首先填充单元格导致延迟。我希望它打开视图然后填充。指示器将显示它们然后加载。