【发布时间】:2011-08-07 19:07:41
【问题描述】:
我是 iphone 开发的新手,我需要一些指导来推送视图。我有以下应用场景“按下按钮->切换视图(包含表格)->按下表格单元格->切换视图”。
要在按下按钮时切换,我使用以下代码:
MapView *screen = [[MapView alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:screen animated:YES];
[screen release];
然后推送另一个视图,我想使用此代码(但它不起作用 - 我问为什么?)
Newclass *nextController = [[Newclass alloc] initWithItem:theItem];
[self.navigationController pushViewController:nextController animated:YES];
[nextController release];
【问题讨论】:
-
你正在使用 self.navigationController 我猜你的 mapview 没有导航控制器
标签: ios objective-c iphone uiviewcontroller xib