У меня есть альбомное приложение, которое я хочу повернуть на 180 градусов, если устройство перевернуто. В моем главном контроллере представления, однако, shouldAutorotateToInterfaceOrientation не вызывается вообще. С чего бы это?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
NSLog(@"ROTATE? %d", interfaceOrientation); //this never gets logged
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
РЕДАКТИРОВАТЬ: В приложении делегат:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:topViewController.view];
[window makeKeyAndVisible];
}