Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy won't my app rotate in Xcode 4/iOS5?
    text
    copied!<p>I'm having trouble getting my app to rotate since switching to Xcode 4 and iOS 5. After tearing my hair out, I created a brand-new test project to see if I could get a bare-bones app to rotate.</p> <p>I created the test project using the 'Empty Application' template. All I added to this template was a UINavigationController, with a UIViewController pushed onto it. There is a nib file for the UIViewController, with one label that says 'Hello'. </p> <p>On the target Summary screen, I clicked in all the buttons for 'Supported Device Orientations'.</p> <p>In the .m files for the Navigation and View controller code I changed shouldAutoRotate... to:</p> <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (YES); } </code></pre> <p>The test project builds with no issues and runs perfectly. There's a navigation bar and friendly 'Hello' message, but the darn thing won't rotate!</p> <p>Obviously, I am missing something pretty simple, but I can't figure out what it is. My suspicion has fallen on the .nib. Under 'Simulated Metrics', there is an attribute called Orientation. This is set to Portrait. The only other choice is 'Landscape'. If I change this setting to 'Landscape' the view in the .nib editor changes to landscape, but when I run the app, it runs in Portrait mode, and still refuses to rotate.</p> <p>Hopefully, someone will get a big laugh out of my blunder and point out the goofy mistake I'm making. Please do!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload