2013-10-24 3 views

답변

0

장치 방향은 실제로 정수입니다. 당신이 할 수있는 일은 버튼을 클릭했을 때 현재 방향으로 설정 한 로컬 변수를 가지고 오리엔테이션 메서드에서 그 방향만을 반환하는 것입니다. 해당 정수가 설정되지 않은 경우 장치의 방향을 반환하십시오. shouldAutorotateToInterfaceOrientation은 iOS 6.0에서 더 이상 사용되지 않습니다. 문서에서 :

shouldAutorotateToInterfaceOrientation : (Deprecated in iOS 6.0. Override the supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation methods instead.) 

편집 : 다음은 UIInterfaceOrientation에 대한 참조입니다.

열거 타입 정의 : {NSInteger UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight, UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft UIInterfaceOrientation};

관련 문제