William Sidell

Software Developer Entrepreneur

  • HomeAll the news
  • Portfoliovery cool stuff
  • AboutA bit about me
  • ConnectFind me on the grid

September 21, 2012
Posted by William

Three20 iOS 6 Rotation

Today, I was working on updating one of my apps for the iPhone 5 and after dealing with iOS 6. I realized my view controllers weren’t rotating. All that was required was simply adding this line after the TTNavigator had been setup.

[[[UIApplication sharedApplication] keyWindow] setRootViewController:[[TTNavigator navigator] rootViewController]];

This is due to the changes in the ViewController rotation API in iOS 6. A rootviewcontroller must be set for the main window of the application.

4 Comments

Posted Under iOS

4 Comments

bradips
September 23, 2012

Thanks,
did you know how to block the rotation only in some views oh the project?

Thank you.

William
September 23, 2012

All you need to do to handle individual view controller rotation is add the methods shouldAutorotate and supportedInterfaceOrientations.

Both are in the new UIViewController documentation.

claris
September 23, 2012

Thanks! It works :D

Jon
October 18, 2012

This doesn’t seem to work for me, please could you include your setup code for three20? eg when you first set up the TTNavigator, and call the first url? I have tried the above and shouldAutoRotate never gets called in the first view controller which three20 visits. If however I init the view controller myself and set window.rootViewController = myFirstViewController, shouldAutoRotate does get called! Very odd!

Thanks

Leave a comment

* = Required

    • Posts
    • Twitter
    • Flickr
     

    iOS 6 UIPasteboard...

    iOS

     

    Three20 iOS 6...

    iOS

     

    1st Place Startup...

    iOS

    Check out this awesome Photo Mosaic I made using "InstaMosaic" for iPhone http://t.co/b4cYtyDu http://t.co/I9uc7clq

    follow me on
    twitter

    _X0A4987.jpgSG1L7207#camping #jemez #newmexico2011
  • Categories

    • Interesting Stuff
    • iOS
    • Tutorials
  • Archives

    • 2012
      • January
      • March
      • September
      • October
    • 2011
      • February
      • March
      • April
      • June
    • 2010
      • October
  • Blogroll

    • Enchanted Cloud Studios

Subscribe via RSS