问个关于多视图切换的问题,加载NIB 后失败
按照书上的例子学习,做多视图程序。
主控制器
SwitchViewController.m
中的一个函数
- (void)viewDidLoad {
BlueViewController *bluecontroller=[[BlueViewController alloc]
initWithNibName:@"BlueView" bundle:nil];
self.blueViewController=bluecontroller;
[self.view insertSubview:bluecontroller.view atIndex:0];
[bluecontroller release];
}
程序运行到 insertSubview 就异常了。
把这函数去掉就可以显示出主控制器对应的界面。
不知道为什么会这样,哪位牛人给指导一下呗。
我可以把我的工程发给你。