0

我有这个代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    TabellenDetailViewController *detailViewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"TabellenDetailViewController"];
    Book2 *aBook2 = [books2 objectAtIndex:indexPath.row];
    detailViewController2.tea_names = [NSString stringWithFormat:@"%@", aBook2.tea_name];
    [self.navigationController pushViewController:detailViewController2 animated:YES];
}

为了更好地理解,我有一个故事板:

导航控制器 -> MasterTableViewController -> DetailMasterTableViewController -> TabelleViewController -> DetailTabelleViewcontroller

它适用于 TabelleViewController,如果我在 TabelleViewController 中选择一个单元格,则程序会因该错误而停止:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([XMLAppDelegate class])); <--- Here with Thread1:Program received signal: "SIGABRT".
    }
}
4

1 回答 1

0
  • 检查tea_names属性是否由TabellenDetailViewController实例保留
  • 添加异常断点以查看确切的异常位置

单击 Navigator 窗格中的 Breakpoints 符号(右起第二个),单击窗格底部的 + 按钮,然后选择 Add Exception Breakpoint。从出现的气泡中,我从 Exception 选项中选择了 Objective-C(尽管我怀疑如果你愿意,你完全可以放心地离开它),我将 Break 选项留在 On Throw 中。单击完成后,列表中应该会有一个新的异常断点。(阅读更多

于 2012-05-28T12:38:11.603 回答