이것은 내 AppDelegate에 있으며 방향 변경시 실행됩니다. 응용 프로그램이로드 될 때 항상 세로 모드로로드됩니다. 장치가 가로 모드에있는 동안 응용 프로그램을로드하면 장치가 세로 모드 인 것처럼 계속 실행됩니다. 그게 내가 가진 첫번째 문제 야. ,AppDelegate에서 방향 감지
-(void)setOrientationView
{
UIDevice *currentDevice = [UIDevice currentDevice];
[currentDevice endGeneratingDeviceOrientationNotifications];
UIDeviceOrientation theOr = currentDevice.orientation;
if (UIDeviceOrientationIsLandscape(theOr) && !isLandVisible)
{
NSLog(@"setLand");
isLandVisible = YES;
isPortVisible = NO;
[self.window.rootViewController pushViewController:portCont animated:YES]; // <Thread 1: breakpoint 2.1
}
if(UIDeviceOrientationIsPortrait(theOr) && !isPortVisible)
{
NSLog(@"setPort");
isPortVisible = YES;
isLandVisible = NO;
[self.window.rootViewController pushViewController:portCont animated:YES];
}
[currentDevice beginGeneratingDeviceOrientationNotifications];
}
내가 부하에 모두 방향을 지원하기 위해 노력하고 내 머리를 당겨하고 스토리 보드 응용 프로그램과 함께, : 두 번째는 내가 세로에서 가로로 장치를 회전 할 때 아래 표기로로드 한 후 나는 스레드 휴식을 얻을 수 있다는 것입니다 (UIWebViews의 재 장전을 막기 위해)보기 후에보기를 닫지 않아도됩니다. 그래서 저를 넘어서는 두 가지 문제가 있습니다. 고마워.
앱이 사용자의 실수가 아닌 세로 모드로로드되는 것은 표준 동작입니다. –
이것은 이렇게하는 방법 일지 모르지만 내 앱에서는 그렇게하지 않으며 두 가지 가로 모드에서만 실행합니다. 대상 구성 (방향을 선택하는 곳)에서 나머지 작업을 rootViewController에서 수행합니다. iOS 6과 iOS 5는 서로 다르기 때문에 지원해야합니다. –
심지어 가속도계가 rootViewController를 통해 켜져 있고 모든 것이 작동하기 때문에 방향을 고정하기 때문에 AppDelegate에 대해 생각하지 않습니다. –