Objective C, TableView error
I have a table view and I have NSMutable array for the tableview's data source. The problem is that if I try to remove all the objects in the NSMutable array before I get the data to re-load the tableview then it crashes. I have this code in viewWillAppear method
- (void) viewWillAppear:(BOOL)animated{
[conversations removeAllObjects];//conversation is NSMutalble array
开发者_运维技巧 [tableView reloadData];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
//I am trying to populate NSMutalbe array here on background
[self performSelectorInBackground:@selector(getPosts) withObject:nil];
}
Check this.... You remove all objects from the mutable array and right after that... you reload the tableview??
What is the table view to reload if the array that's the data source is empty at that moment?
精彩评论