Re: My App refuses to rotate
Re: My App refuses to rotate
- Subject: Re: My App refuses to rotate
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 28 May 2013 14:22:21 +0700
On 28 May 2013, at 14:03, David Duncan <email@hidden> wrote:
> Did you set the window's rootViewController to your view controller?
In WordsViewController (subclass of UIViewController) I added:
UIView *view = ss.view;
UIWindow *window = view.window;
UIViewController *rootViewController = window.rootViewController;
NSLog(@"%s %@ self %p view %p window %p rootViewController %p",__FUNCTION__,
a, self, view, window, rootViewController);
which prints:
+[WordsViewController printControllersFor:at:] searchOption self 0x1238c0 view 0x2012c000 window 0x1f541270 rootViewController 0x2097fca0
BaseViewController has:
- (NSUInteger)supportedInterfaceOrientations
{
UIInterfaceOrientationMask a = COMMON_ORIENTATION;
NSLog(@"%s %#lx %p",__FUNCTION__,a, self);
return a;
}
which prints repeatedly:
-[BaseViewController supportedInterfaceOrientations] 0x1e 0x2097fca0
So the rootViewController seems to be my BaseViewController.
The superview hierarchy of WordsViewController is:
super 0x2012c000 UITableView
super 0x21d05b80 UIViewControllerWrapperView
super 0x1f53db90 UINavigationTransitionView
super 0x1f53e8f0 UILayoutContainerView
super 0x1f541270 UIWindow
Another thing:
Just tried it again on the device (iPhone 4S) and got the top bar (with battery percentage, etc.) and the keyboard in LandscapeRight (the first item in UISupportedInterfaceOrientations) but the table view still in portrait.
And it still did not rotate.
Changed the order in UISupportedInterfaceOrientations to start with UIInterfaceOrientationPortrait. Now it is at least usable (but still does not rotate).
>
> On May 28, 2013, at 12:01 AM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> I have an iOS 6.1 app.
>>
>> Info.plist contains:
>> <key>UIInterfaceOrientation</key>
>> <string>UIInterfaceOrientationPortrait</string>
>>
>> <key>UISupportedInterfaceOrientations</key>
>> <array>
>> <string>UIInterfaceOrientationLandscapeRight</string>
>> <string>UIInterfaceOrientationLandscapeLeft</string>
>> <string>UIInterfaceOrientationPortrait</string>
>> <string>UIInterfaceOrientationPortraitUpsideDown</string>
>> </array>
>>
>> <key>UISupportedInterfaceOrientations~ipad</key>
>> <array>
>> <string>UIInterfaceOrientationPortrait</string>
>> </array>
>>
>> All ViewControllers have:
>>
>> - (NSUInteger)supportedInterfaceOrientations
>> {
>> return UIInterfaceOrientationMaskAll;
>> }
>>
>> But in the iPhone simulator and in the iPhone device the rootViewController always has interfaceOrientation = 1 (Portrait).
>> All other ViewControllers also show interfaceOrientation = 1 (Portrait).
>>
>>
>> Why does the App not rotate?
>>
>> What am I missing?
>>
>> Gerriet.
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> --
> David Duncan
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden