我只需要我的应用程序中的一个视图以横向显示,一切正常,但我收到一个警告我想摆脱,这是该视图的视图控制器中的代码..
在 viewDidLoad
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];
和,
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
但我收到警告
UIDevice 可能无法响应 -setOrientation:
在我看来DidLoad,
它有效,但我不喜欢那个警告,那么请问如何解决这个问题?
多谢!!