I had this block of code and it worked on iPhone 4S and below. Now with iPhone 5s 4 inch screen it throws an error. I can get around it by commenting out [appDel.navController.view removeFromSuperview]; but I dont think that is the proper way. I dont think this is either so if someone can shed a little light on this that would be great.
Thanks
Code:
[appDel.tabController setSelectedIndex:0];
[appDel.window addSubview:appDel.tabController.view];
[appDel.window bringSubviewToFront:appDel.navController.view];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.6];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:appDel.navController.view.superview cache:NO];
[appDel.navController.view removeFromSuperview];
When you are referring to a some object via multiple accessors, e.g. “
appDel.navController.view” (I’m trying to think of the formal Objective C name for this, maybe somebody looking at my answer down the road could remind me), it’s very likely that you can get burned by a result not being what you would expect it to be.In my own code, I try to do as much error checking as possible.
The code below might help you to isolate the issue. In a practical sense, you don’t need so many lines of code, but this might help you to get the idea of what might be going wrong here.