我有一个UIViewController,这个控制器包含在一个navigationController中。 我在这个viewController中添加一个UITableViewController。当我按下tableView的单元格时,我想调用pushViewController方法。pushViewController with tableViewController in viewController
我尝试这样做:
的UITableViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
FirstView *myViewController = [[FirstView alloc] init];
[f myViewController];
}
的UIViewController(的firstView)
-(void)pushIt
{
SecondView *sCont = [[SecondView alloc] initWithNibName:@"SecondView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:sCont animated:YES];
NSLog(@"didSelect"); // is printed
[sCont release];
sCont = nil;
}
但没有发生。我把NSLog()放到了我的pushIt方法中,我可以看到它。所以我不明白为什么我不能推它。
任何想法?
反正什么? – willcodejavaforfood 2010-02-10 09:33:55
Oups我将f更改为myViewController var name以获得更多理解,但我忘记在我的调用中更改它。所以:[myViewController pushIt] – Pierre 2010-02-10 11:55:30