【发布时间】:2013-11-13 03:16:57
【问题描述】:
我有一个通用横向模式应用程序。 SKStoreProductViewController 在 iPad 上运行良好。但是在 iphone ios 7 上崩溃了。即使我将 SKStoreProductViewController 设置为在 iPhone 上纵向显示。
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
NSLog(@"iphone portrait");
return UIInterfaceOrientationPortrait;
}
else
return [super preferredInterfaceOrientationForPresentation];
}
SKStoreProductViewController 在 iPhone iOS 7 上显示为纵向,但是当我旋转手机时,它会崩溃。我收到错误消息说:
* 由于未捕获的异常“UIApplicationInvalidInterfaceOrientation”而终止应用程序,原因:“支持的方向与应用程序没有共同的方向,并且 shouldAutorotate 正在返回 YES”
有人知道如何解决这个问题吗?
谢谢
【问题讨论】:
标签: iphone objective-c ipad ios7 landscape-portrait