self.window.rootViewController.presentedViewController
self.window.rootViewController.presentedViewController Rückkehr null
immer nil Rückkehr obwohl es Viewcontroller zur Verfügung steht. Nicht sicher, was ich falsch mache.
Im Folgenden finden Sie den vollen Code-
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
NSLog(@"this is loaded");
if ([self.window.rootViewController.presentedViewController isKindOfClass:[SecondViewController class]])
{
SecondViewController *secondController = (SecondViewController *) self.window.rootViewController.presentedViewController;
if (secondController.isPresented)
{
return UIInterfaceOrientationMaskLandscape;
}
else return UIInterfaceOrientationMaskPortrait;
}
else return UIInterfaceOrientationMaskPortrait;
}
Wie präsentieren Sie View Controller? –
Verwendung der TableView-Delegate-Methode, Wählte Zeile im Index, – iosDev
detailViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self.navigationController pushViewController: detailViewController animiert: NO]; – iosDev