numberOfRowsInSection called befor openWithCompletionHandler block
- (void)viewDidLoad
{
[super viewDidLoad];
if (self.document.documentState == UIDocumentStateClosed){
[self.document openWithCompletionHandler:^(BOOL success) {
self.list = [[Categories
getArrayForFirstTable:self.document.managedObjectContext]
mutableCopy];
}];
}
[self.tableView reloadData];
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [self.list count];
}
numberOfRowsInSection called befor openWithCompletionHandler's block.
[self.list count] is nil ,why?
No comments:
Post a Comment