【发布时间】:2011-02-25 00:10:12
【问题描述】:
我只需要在我的应用程序中显示一个视图以横向显示,一切正常,但我收到一个警告,我想摆脱它,这是视图控制器中该视图的代码..
在 viewDidLoad 中
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];
和,
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
但我收到警告
UIDevice 可能无法响应 -setOrientation:
在我看来DidLoad,
它有效,但我不喜欢这个警告,请问如何解决这个问题??
非常感谢!!
【问题讨论】:
标签: iphone warnings landscape viewcontroller