如何从当前视图移动到另一个视图?我目前的观点是viewcontroller,我想移动另一个视图控制器。这是我的代码..移动到UITableView行选择的另一个视图
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SecondView *secondView = [[SecondView alloc] initWithNibName:@"second" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:secondView animated:YES];
}
我使用xib文件作为另一个视图。
什么是SecondView? (一个视图控制器,或?) – 2011-03-08 11:51:00
第二个视图是另一个UIViewController。 – Maulik 2011-03-08 11:53:22
你为什么要专门调用initWithNibName:bundle:? (默认情况下,调用init将包含类似于'if(self = [super initWithNibName:nil bundle:nil]){'这会为你加载nib。“ – 2011-03-08 11:55:02