我的委托上有两个选项卡控制器,我想根据需要切换它们。 RootController显示为默认,当我想从另一个类我用显示secondController,在两个控制器之间的iOS切换
myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:appDelegate.secondController.view];
[appDelegate.rootController.view removeFromSuperview];
问题是,当我想回去用同样的方法。由于不好的acces异常崩溃...
myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:appDelegate.rootController.view];
[appDelegate.secondController.view removeFromSuperview];
任何帮助,将不胜感激。谢谢。
你在你的应用的两个tabbarcontrollars? ..或者只是一个tabbarcontroller有两个视图控制器在里面? – Shubhank 2012-04-28 18:39:19
两个tabBarControllers! – Jaume 2012-04-28 18:39:58
给你的BOOL appdidFinishLaunching方法代码..它应该在应用程序delegate.m文件 – Shubhank 2012-04-28 18:41:58