2012-07-22 59 views
0

當我行點擊導航到其他視圖它給我的崩潰我不能導航到(didSelectedRowAtIndexPath)另一種觀點

"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]; 
} 

回答

0

問題在於你從視圖的框架中刪除了一個圖形對象,而沒有刪除出口連接。選擇您的視圖控制器的.xib,然後選擇File's Owner(左鍵單擊它)並刪除lblText對象的插座連接。編譯&運行。應該沒問題。

+0

我刪除它,但它仍然使crashTerminating應用程序由於未捕獲異常'NSInvalidArgumentException',原因:' - [__ NSCFString url]:無法識別的選擇發送到實例0x686d580' – 2012-07-22 10:57:59

+0

您收到此異常? – azimov 2012-07-22 11:05:21

+0

當我選擇行 – 2012-07-22 12:17:23