【发布时间】:2013-08-17 10:53:41
【问题描述】:
- (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];
}
在 openWithCompletionHandler 的块之前调用 numberOfRowsInSection。
[self.list count] 为 nil,为什么?
【问题讨论】:
标签: objective-c uitableview core-data