Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.6.7 crashes due to wrong return value of supportedInterfaceOrientations method #129

Closed
allenhsu opened this issue Oct 20, 2015 · 5 comments

Comments

@allenhsu
Copy link

Crash:

Fatal Exception: UIApplicationInvalidInterfaceOrientation
Supported orientations has no common orientation with the application, and [LTHPasscodeViewController shouldAutorotate] is returning YES

Related method:

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    if (_displayedAsLockScreen)
        return LTHiOS8 ? UIInterfaceOrientationMaskPortrait : UIInterfaceOrientationMaskAll;
    // I'll be honest and mention I have no idea why this line of code below works.
    // Without it, if you present the passcode view as lockscreen (directly on the window)
    // and then inside of a modal, the orientation will be wrong.

    // If you could explain why, I'd be more than grateful :)
    return UIInterfaceOrientationMaskPortraitUpsideDown;
}

In versions before v3.6.7, you mistakenly used UIInterfaceOrientationPortraitUpsideDown (2), which should be UIInterfaceOrientationMaskPortrait (2), coincidentally they have same value of 2, so it worked.
In v3.6.7, you used UIInterfaceOrientationMaskPortraitUpsideDown of which the value is actually (1 << 2 = 4), so the app crashes.

Solution:
You should use UIInterfaceOrientationMaskPortrait.

@rolandleth
Copy link
Owner

I need to test if everything else keeps working, since, as I wrote there, I don't know why it worked before only like that. Thanks for the tip!

@ddaddy
Copy link
Contributor

ddaddy commented Oct 20, 2015

I can confirm this too. Using UIInterfaceOrientationMaskPortrait works and stops the crash.

@rolandleth
Copy link
Owner

Fixed in 3.6.8, would be great if any of you could confirm and close.

@ddaddy
Copy link
Contributor

ddaddy commented Oct 20, 2015

I already made the change in my code and it worked :)
While your here, could you take a look at #126

@rolandleth
Copy link
Owner

Hopefully I will manage to, later during the day. What about this issue, #129? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants