Re: My Phone does not work upside down
Re: My Phone does not work upside down
- Subject: Re: My Phone does not work upside down
- From: Roland King <email@hidden>
- Date: Tue, 14 Apr 2015 23:00:23 +0800
> On 14 Apr 2015, at 22:35, Gerriet M. Denkmann <email@hidden> wrote:
>
>
>> On 14 Apr 2015, at 21:21, Jens Alfke <email@hidden> wrote:
>>
>>
>>> On Apr 14, 2015, at 4:57 AM, Roland King <email@hidden> wrote:
>>>
>>> Read the manual.
>
> Excellent advice. I have been following this since hours.
>
> As to supportedInterfaceOrientations:
> All my subclasses of UIViewController have this implemented - none gets ever called.
>
> - (NSUInteger)supportedInterfaceOrientations
> {
> UIInterfaceOrientationMask mask = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ?
> UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown :
> UIInterfaceOrientationMaskAll;
> NSLog(@“%s %#lx”,__FUNCTION__,mask); ← never seen this
> return mask;
> }
>
Which of them would you have expected to be called? Which one is the root view controller or topmost presented view controller that fills the window? As per the documentation
"the system calls this method on the root view controller or the topmost presented view controller that fills the window"
>>
>
>> +1.
>>
>> In addition to what Roland said, it’s also staring you right in the face in the General tab of the target settings as a set of friendly checkboxes.
>
> When I click on Target → General I see under “Deployment Info - Device Orientation” 4 checkboxes, which look friendly enough. Only the first two (Portrait and Upside Down) are selected.
>
> But iPad works in all 4 orientations. Seams that the Info.plist overrides the friendly checkboxes.
> And iPhone works only in Portrait - NOT upside down.
No, the Info.plist *is* the friendly checkboxes, they are one and the same. The boxes you select there are what ends up in the Info.plist file. It has separate sets of boxes for iPhone and iPad, which one are you looking at, the iPhone one only I suspect.
And, again per the documentation you’ve been reading
"The default values for a view controller's supported interface orientations is set to UIInterfaceOrientationMaskAll <file:///Users/rols/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/c/econst/UIInterfaceOrientationMaskAll> for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown <file:///Users/rols/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/c/econst/UIInterfaceOrientationMaskAllButUpsideDown> for the iPhone idiom."
>
> Kind regards,
>
> 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