orientation help

Discussion in 'iOS Programming' started by uaecasher, Jun 8, 2010.

  1. uaecasher macrumors 65816

    uaecasher

    Joined:
    Jan 29, 2009
    Location:
    Stillwater, OK
    #1
    hello,

    I'm trying to add support for orientation for my app but it's not working, I've tried this code with my other app and it's working just fine, my app is tabbar app (the one which isn't working), here is the code:

    Code:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        return YES;
    }
    
     
  2. NickVellios macrumors member

    Joined:
    Jun 6, 2010
  3. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    In a tabbar app every view controller must support rotation.
     
  4. uaecasher thread starter macrumors 65816

    uaecasher

    Joined:
    Jan 29, 2009
    Location:
    Stillwater, OK
    #4
    I've added them into all the view controllers
     
  5. PatrickCocoa macrumors 6502a

    Joined:
    Dec 2, 2008
    #5
    You may want to put some NSLogs as the first statement in every/most/some of the methods in every/most/some of your classes. Then you can see if 1) the shouldAutorotate method is getting called but you're setting it wrong; or 2) if it's not getting called at all. If it's not getting called (which I suspect is what's going on), you can look at the NSLogs to see which object is getting the messages. At that point you can either put the shouldAutorotate in that object or figure out why your view controllers aren't getting their shouldAutorotate methods called.

    Crude, but for tracing which method gets called by the application loop and when, it's effective.
     
  6. NickVellios macrumors member

    Joined:
    Jun 6, 2010
    #6
    Nothing crude about logging to the console. Every developer I know does this all over in their code. Great suggestion.
     

Share This Page