ios - 准备序列时在事务内调用 CATransaction 同步

标签 ios segue

我有 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/

相关文章:

javascript - 使 YouTube JS API 与 iOS 一起工作,处理 embedSWF?

ios - 无法在自定义单元格中使用 UISwitch 以移动到新 Controller

ios - 如何使用 CloudKit 查询条件化 Segue?

ios - 调用自定义 Segue 类执行方法,操作不执行任何操作

ios - 如何知道 UITableView 已完成 swift 中的数据加载

javascript - IOS相机离开pwa后返回黑屏

iphone - 为 MonoTouch.Dialog 创建自定义 Section 类?

ios - CoreBluetooth 反复断开连接

ios - 如何使用 Storyboard 的详细信息披露按钮?

swift - performSegueWithIdentifier 后无法隐藏 BackButton