基本上我添加一個子視圖到主窗口。這個子視圖有一個搜索欄和一個表格視圖。搜索欄起作用,它在表格視圖單元格上顯示一些數據。現在,當我點擊一個單元格時,它應該使用導航欄(w /後退按鈕)和該視圖中的表格加載另一個視圖。如何才能做到這一點?我嘗試了下面的代碼,它不起作用,它給了我一個錯誤 - 「' - [UIViewController _loadViewFromNibNamed:bundle:]加載了」DetailViewController「筆尖,但未設置視圖插口。如何打開一個新的UITableView時單擊表格單元格,並動態添加導航控制器
我試圖設置在DetailViewController.nib文件出口的,但它只是不會讓我。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:[[UITableViewController alloc]initWithNibName:@"DetailViewController" bundle:nil]];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
}