我有一个带数据的uitableview单元格。
当我选择一个单元格时,我希望表视图将我重定向到另一个视图。
我要做的是:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    Multa *multa = [self.multas objectAtIndex:indexPath.row];

    DetalheMultaViewController *form = [[DetalheMultaViewController alloc] initWithMulta:multa];
    form.delegate = self;

    [self.navigationController pushViewController:form animated:YES];
}

然而,在最后一行中,我得到了这个错误:exc_bad_指令。
在控制台里我得到了这个信息(我明白你在说什么,但不明白发生了什么):
2012-09-16 17:11:25.719 Multas Sociais[5092:11603] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DetalheMultaViewController 0x7a46e10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key fotoUrl.'
*** First throw call stack:
(0x1547052 0x1b0cd0a 0x1546f11 0xf2d032 0xe9ef7b 0xe9eeeb 0xeb9d60 0x7ac91a 0x1548e1a 0x14b2821 0x7ab46e 0x652e2c 0x6533a9 0x6535cb 0x652c1c 0x67956d 0x663d47 0x67a441 0x67a4f9 0x871c68 0x6314a1 0x63212b 0x8714c7 0x65a427 0x65a58c 0x65a5cc 0x3c2f 0x61d71d 0x61d952 0xea586d 0x151b966 0x151b407 0x147e7c0 0x147ddb4 0x147dccb 0x1f7a879 0x1f7a93e 0x58da9b 0x2608 0x2565)
terminate called throwing an exception(gdb)

思想?
非常感谢你。

最佳答案

您可能有一个名为fotoURL的旧iboutlet,直到它连接到xib文件中的某个对象,而您从代码中的.h中删除了iboutlet。
编辑xib文件并删除到旧fotoURL插座的连接。
如果这还不够,您可能需要清理您的项目(“产品”菜单,“清理”,或为了更好的结果按住“alt”键并选择“清理生成文件夹…”),然后再重新生成它。

10-08 07:48