Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
the method
Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
has been overridden in the subclass of uiviewcontroller to always return YES

this subclass is a subview on the window added in the appdelegate

sometimes the rotating methods like
Code:
- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration
never get called when the device is rotated
sometimes it does
sometimes it just crashes and i can't figure out why

whatever it chooses to do it's consistent.. so if it decides that it doesn't want to call the rotate method then it never will

i'm not sure what's wrong... any hints or tips?
 
Apple's design of UIViewControllers is based around the idea of a single view controller at a time that controls a view that covers the entire screen. You specify that view controller by the appropriate methods in UINavigationController or UITabController.

If you have another set up you will have problems. Using a hidden navigation controller is one way to do things.
 
sometimes it just crashes and i can't figure out why
If it's crashing, it almost certainly has nothing to do with how these methods are being called (unless you've found a bug with the OS, which you should file) and is probably related to the code you have added to these methods. Have you looked at the console, crash logs, etc. to determine the cause?
 
Phoney: it only has one scrollview on the window... i'm not sure why the rotate methods aren't always being called or why they do something completely different to what they should do sometimes

dejo: if it crashes it just prints to the console
Program received signal: "EXC_BAD_ACCESS".
the stack trace in the debugger is all greyed out and just shows memory adresses
the top few entries are..
objc_msgSend
??
-[UIWindow _shouldAutorotateToInterfaceOrientation:]
-[UIWindow _updateToInterfaceOrientation:duration:force]
but it's not always that, sometimes it's different...
 
i eliminated the zombies that started showing up so now it seems like it randomly chooses to rotate or not rotate...

sometimes the rotate methods get called other times it doesn't... i dont quite understand why it would sometimes do it and sometimes not...
 
a simple NSLog statement just printing out the string @"SHOULD AUTO ROTATE TO INTERFACE ORIENTATION"
and a
Code:
return YES;
line
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.