关于在iOS sdk 6.1中使用setOrientation

关于在iOS sdk 6.1中使用setOrientation,ios,webview,setorientation,Ios,Webview,Setorientation,我正在做一个基于phonegapiOS的项目。我们在同一个webview中加载网站页面和本地html页面。加载某些页面时,视图将为纵向,其中一些页面为横向,其他页面将同时支持横向和纵向。现在,当我尝试: [UIDevice currentDevice] setOrientation: UIDeviceOrientationPortrait]; 出现错误:没有可见的@interface for'UIDevice'声明选择器“setOrientation:” 这是关于sdk的版本还是其他什么?我

我正在做一个基于phonegapiOS的项目。我们在同一个
webview
中加载网站页面和本地html页面。加载某些页面时,视图将为纵向,其中一些页面为横向,其他页面将同时支持横向和纵向。现在,当我尝试:

[UIDevice currentDevice]  setOrientation: UIDeviceOrientationPortrait];
出现错误:
没有可见的@interface for'UIDevice'声明选择器“setOrientation:”
这是关于sdk的版本还是其他什么?我看到其他人可以使用它,只是在堆栈溢出上得到警告


对不起,我的英语不好。

在iOS 6
setOrientation
中已贬值,您应将其替换为:

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
查看以下问题了解更多详细信息:

自iOS6以来,UIDevice的“”属性为“只读”

要控制iOS6中的界面方向,可以参考Apple文档