我有 UITableViewController,当我点击一个单元格时,我想显示 UINavigationController,并将 UITableViewController 作为模态视图。
我有这个函数来准备序列:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"ShowTitles"]) {
UINavigationController *navigationController = (UINavigationController *)segue.destinationViewController;
if (navigationController) {
DataListViewController *dataListController = (DataListViewController *)[navigationController topViewController];
if (dataListController) {
dataListController.delegate = self;
dataListController.viewTitle = NSLocalizedString(@"Titles", nil);
dataListController.dataArray = [NSMutableArray arrayWithArray:self.titles];
}
}
}
}
但是当我点击单元格时,我收到此错误:CATransaction在事务内同步调用。
什么可能导致该错误?
编辑: 它发生在 cellForRowAtIndexPath 函数的这个地方:
[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
最佳答案
我没有注意到对于函数 dequeueReusableCellWithIdentifier:forIndexPath: 我必须注册该类,所以我在 viewDidLoad 函数中完成了它:
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];
关于ios - 准备序列时在事务内调用 CATransaction 同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19779933/