小弟刚刚入门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之间切换有什么好的方法吗?
诚恳的向大家学习

解决方案 »

  1.   

    因为没有整个工程,所以不好推测原因,不过,请把下面的这句话AnotherController *anotherController=
    [[AnotherController alloc]
    initWithNibName:@"AnotherView" bundle:nil];换成。
    AnotherController *anotherController=
    [[AnotherController alloc]
    initWithNibName:@"AnotherView" bundle:[NSBundle mainBundle]]; 
      

  2.   

    此外,你的界面切换,我能否猜测成是view a转到view b,那样使用基本的动画效果会很好,具体可以到apple的开发者官方网站中找,BubbleLevel
      

  3.   


    嗯 是view a 转到view b   但是a嵌入在TabBarController里面
      

  4.   

    请把代码发到邮箱,[email protected],明天应该有空帮你看看。