- (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 は、openWithCompletionHandler のブロックの前に呼び出されます。
[self.list count] は nil です。なぜですか?