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 に答える