Xcode 4.5 iOS 6.0 симулятор ориентации не работает
Я обновил свой Xcode до 4.5, я реализовал методы ориентации, как показано ниже
-(BOOL)shouldAutorotate{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}
Я устанавливаю размеры рамки кнопок, меток, изображений в методе willRotateToInterfaceOrientation
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait )||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown ))
{
// set frame sizes for portait
}
else if(( [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft )||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight ))
{
// set frame sizes for landscape
}
}
но иногда этот метод не вызывается при вращении симулятора, а иногда симулятор не определяет ориентацию при навигации из другого viewController. Я проверил файл info.plist - все хорошо.