0

当我单击行导航到另一个视图时,它让我崩溃

"Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<detailInfo 0x6b503d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key lblText.'
*** First throw call stack:
"

这是我的代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{   
    _vcontroler = [ urls objectAtIndex:indexPath.row];

    if (!self.detailViewController)
    {
         self.detailViewController = [[[detailInfo alloc] initWithNibName:@"detailInfo" bundle:nil] autorelease];

    }
      detailViewController.vcontroler =_vcontroler; 

    [self.navigationController pushViewController:self.detailViewController animated:YES];

    [detailViewController release];
}
4

1 回答 1

0

问题是您从视图的框架中删除了一个图形对象,而没有删除出口连接。选择您的视图控制器.xib,然后选择File's Owner(左键单击它)并删除lblText对象的出口连接。构建并运行。应该没问题。

于 2012-07-22T10:52:31.757 回答