我已经实现了一个方法 didSelectRowAtIndexPath 应该推送另一个视图。我有一个使用navigationController 正确运行的代码,但在这种情况下,我在视图上使用navigationItem 。我怎么能触发视图?谢谢
错误日志:
2010-03-25 00:09:52.459 TableArchive[1062:207] trigger
2010-03-25 00:09:52.461 TableArchive[1062:207] *** -[UINavigationItem pushViewController:animated:]: unrecognized selector sent to instance 0x3921ca0
2010-03-25 00:09:52.462 TableArchive[1062:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UINavigationItem pushViewController:animated:]: unrecognized selector sent to instance 0x3921ca0'
2010-03-25 00:09:52.463 TableArchive[1062:207] Stack: (
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"trigger");
if(dvController == nil) {
DetailView *aController =[[DetailView alloc]initWithNibName:@"DetailView" bundle:nil];
self.dvController = aController;
[aController release];
}
[[self navItem]pushViewController:dvController animated:YES];
[dvController release];
}