小弟刚刚入门iPhone开发
今天在做一个多界面切换的小demo
以前只是一个简单的界面切换.现在当前界面是一个view视图.
NavigationItem Action 和 More 是直接从库里拖上去的.
然后和里面的事件相连接的.现在我又新建了一个nib视图.当点more的就可以切换出来.
现在我在界面的切换遇到问题了.-(IBAction)viewSwitch:(id)sender{
[self.view removeFromSuperview];
AnotherController *anotherController=
[[AnotherController alloc]
initWithNibName:@"AnotherView" bundle:nil];
[self.view insertSubview:anotherController atIndex:0];
}
一执行最后的insetSubview程序就死了/// 在view和view之间切换有什么好的方法吗?
诚恳的向大家学习
今天在做一个多界面切换的小demo
以前只是一个简单的界面切换.现在当前界面是一个view视图.
NavigationItem Action 和 More 是直接从库里拖上去的.
然后和里面的事件相连接的.现在我又新建了一个nib视图.当点more的就可以切换出来.
现在我在界面的切换遇到问题了.-(IBAction)viewSwitch:(id)sender{
[self.view removeFromSuperview];
AnotherController *anotherController=
[[AnotherController alloc]
initWithNibName:@"AnotherView" bundle:nil];
[self.view insertSubview:anotherController atIndex:0];
}
一执行最后的insetSubview程序就死了/// 在view和view之间切换有什么好的方法吗?
诚恳的向大家学习
[[AnotherController alloc]
initWithNibName:@"AnotherView" bundle:nil];换成。
AnotherController *anotherController=
[[AnotherController alloc]
initWithNibName:@"AnotherView" bundle:[NSBundle mainBundle]];
嗯 是view a 转到view b 但是a嵌入在TabBarController里面