【发布时间】:2011-09-29 13:51:49
【问题描述】:
我有一个应用程序,它有一个名为 store 的视图。在此视图中,有一个加载 DetailView 的按钮。问题是这个细节视图没有加载/显示。这是我使用的代码:
-(void)knop:(id)sender{
categoryView = [[CategoryView alloc] init];
//show detail view using buttonDetail...
[self.navigationController pushViewController:categoryView animated:YES];
[categoryView release];
NSLog(@"Button is working");
}
日志“按钮正在工作”日志,因此 pushViewController 行也被触发。
categoryView 是在我的 .h 文件中制作的:
CategoryView IBOutlet *categoryView;
}
@property (nonatomic, retain) IBOutlet CategoryView *categoryView;
在 store.xib 中有一个 UIViewController,其出口链接到 categoryView 出口。
在我的应用程序的其他地方,它正在工作,我似乎无法找出为什么这个不是
任何帮助将不胜感激! 太棒了
【问题讨论】:
-
是
CategoryView一个 UIView 或 UIViewController。 pushViewController 方法只适用于 UIViewControllers。还有一个 UINavigationController 持有categoryViewviewCointroller? -
这是一个 UIViewController: @interface CategoryView : UIViewController{
-
你的“根”视图控制器在 UINSvigationController 中吗?
-
我只有UIViewController,那我应该在store.xib中放一个UINavigationController吗?
-
您使用的是什么类型的应用程序?是基于导航还是基于标签栏?
标签: iphone objective-c ios uinavigationcontroller pushviewcontroller