开发者

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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜