2011-02-25 8 views
0

가로로 표시하려면 내 앱에서 하나의보기 만 필요합니다. 모두 작동하지만 경고에서 벗어나고 싶습니다.이보기의보기 컨트롤러에있는 코드입니다. .가로 방향으로 한 번보기

이있는 viewDidLoad

 [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft]; 

과에서

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); 
} 

하지만 경고를 얻을

UIDevice는 -setOrientation에 respont하지 않을 수 있습니다 내있는 viewDidLoad에서

작동하지만 그 경고처럼 해달라고, 그래서 어떻게 좀 해결하기 위해?

감사합니다.

+2

http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation – Max

답변

0

UIDevice의 방향 속성이 읽기 전용이고 사용자가 설정하지 않아야하기 때문입니다.

가로 모드에서 실행되도록 응용 프로그램을 설정하는 적절한 방법을 찾으려면 Link that Max posted을 읽으십시오.

관련 문제