uiview controller not calling rotate methods

Discussion in 'iOS Programming' started by Chirone, Feb 21, 2010.

  1. Chirone macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    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?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    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.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    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?
     
  4. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #4
    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
    the stack trace in the debugger is all greyed out and just shows memory adresses
    the top few entries are..
    but it's not always that, sometimes it's different...
     
  5. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #6
    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...
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    shouldAutorotateToInterfaceOrientation: should always get called. What code does it contain?
     
  7. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #8
    a simple NSLog statement just printing out the string @"SHOULD AUTO ROTATE TO INTERFACE ORIENTATION"
    and a
    Code:
    return YES;
    line
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #9
    Would you like to show some code?

    How do you create your UI?
     

Share This Page