iOS - Sperre eine bestimmte UIViewController, um eine bestimmte Ausrichtung

Meine Anwendung unterstützt alle 4 Orientierung, ich habe eine UIViewController die in LandscapeRight.
Ich bin mit UINavigationController zu drängen, dass die UIViewController möchte ich, dass UIViewController werden nur in UIInterfaceOrientationLandscapeRight aber wenn ich das Telefon drehen, schaltet es zurück, um anderen Orientierung.

-(BOOL)shouldAutorotate{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationLandscapeRight;
}

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationLandscapeRight;
}
Schreibe einen Kommentar