iOS6 으로 업데이트 되면서 기존의 shouldAutorotateToInterfaceOrientation 메소드가 deprecated 되었습니다.
iOS6 에서는 shouldAutorotate, supportedInterfaceOrientations, preferredInterfaceOrientationForPresentation 이렇게 3가지 메소드로 구현해야 합니다.
deployment taget 을 5.0 부터 하기 위해서는 iOS5 방식과 iOS6 방식 2가지 모두 구현하면 됩니다.
아래 코드 참고 하세요. (landscape 모드 설정 입니다)
//iOS5 setting
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
//iOS6 setting
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;
}
'Dev > iOS' 카테고리의 다른 글
| [XCODE] Snow Leopard, XCode 4.2 에서 설치 실패시... (2) | 2012.04.09 |
|---|---|
| [iOS] 현재 어플리케이션의 window, view 가져오기 (0) | 2012.03.08 |
| [iOS] 소요시간 알아내기 (0) | 2011.12.14 |
| [XCode] Xcode 4.2(iOS5)에서 ARC(Automatic Reference Counting) 키고 끄기 (0) | 2011.10.26 |
| [Objective-C] Property - (assign, retain, copy) (1) | 2011.10.05 |
