IOS7中的PushViewController崩溃 [英] PushViewController Crash in IOS7
问题描述
我在IOS7中遇到奇怪的问题当我尝试使用IOS6在xcode5中运行我的旧应用程序时,每件事情都运行良好,但是当我尝试推送Nextview时它与IOS7崩溃。这是我的应用程序崩溃的代码。
I am facing strange issue in IOS7 when I try to run my old app in xcode5 with IOS6 every thing working fine,but with IOS7 when I am trying to Push Nextview it Crash.Here is code where my app Crash.
FamilyBioViewController *detailView=[[FamilyBioViewController alloc] initWithNibName:@"FamilyBioView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
当发生崩溃时,它没有在控制台中显示任何错误。下面的屏幕截图显示崩溃结果
有趣的是当我用 presentViewController <来呈现我的视图时/ strong>而不是
pushViewController 然后它在IOS 7中正常工作。
When crash happened it did not show any error in console.The below screenshot show the crash result Interesting thing is when I present my view with presentViewController instead of pushViewController then it is working fine in IOS 7 .
FamilyBioViewController *detailView=[[FamilyBioViewController alloc] initWithNibName:@"FamilyBioView" bundle:[NSBundle mainBundle]];
[self presentViewController:detailView animated:YES completion:nil];
[detailView release];
所以问题是为什么pushViewController会导致IOS7出现问题?任何帮助将不胜感激。谢谢。
So the Question is why pushViewController Causing problem in IOS7 ? Any help will be appreciated.Thanks in advance.
编辑:
欲了解更多详情,请参阅我的应用流程这里是我的AppDelegate代码
For more Detail see my app Flow and here is my AppDelegate Code
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if(tabBarController.selectedIndex==1 || tabBarController.selectedIndex==3)
{
[(UINavigationController *)[tabBarController selectedViewController] popToRootViewControllerAnimated:NO];
}
}
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
return YES;
}
推荐答案
视图中的视图控制器控制器数组必须是唯一的
The view controller in the view controller array must be unique
这篇关于IOS7中的PushViewController崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!