I have a strange problem. I received an error message stating that the application crashed due to a change in orientation. The problem is that I did not subscribe to any indicative events in the application code at all. The only thing related to changing orientation changes:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return IS_IPAD ? YES : interfaceOrientation == UIInterfaceOrientationPortrait; }
... on all view controllers, so that it changes orientation on the iPad, but not the iPhone. And the error occurred on the iPhone.
IS_IPAD comes from this:
#ifdef UI_USER_INTERFACE_IDIOM #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #else #define IS_IPAD (false) #endif
It seems that -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] calls some object that no longer exists. What can be an object if I am not registered for any orientation related notifications?


source share