问题
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];
When crash happened it did not show any error in console.The below screenshot show the crash result

FamilyBioViewController *detailView=[[FamilyBioViewController alloc] initWithNibName:@"FamilyBioView" bundle:[NSBundle mainBundle]];
[self presentViewController:detailView animated:YES completion:nil];
[detailView release];
So the Question is why pushViewController Causing problem in IOS7 ? Any help will be appreciated.Thanks in advance.
Edit: For more Detail see my app Flow

- (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;
}
回答1:
FamilyBioViewController *detailView = [[[FamilyBioViewController alloc] initWithNibName:@"FamilyBioView" bundle:[NSBundle mainBundle]] autorelease];
[self.navigationController pushViewController:detailView animated:YES];
---- EDIT ---- my example above it's not the solution!
don't forget to declare your first viewController for a navigationController
in iOS6 it wasn't a big problem. In iOS7 it is!
have a look to
[[UINavigationController alloc] initWithRootViewController: (UIViewController *)controller]
You can push only if you have a root!
回答2:
The view controller in the view controller array must be unique
来源:https://stackoverflow.com/questions/20005721/pushviewcontroller-crash-in-ios7