私のアプリケーションは iOS5 で正常に動作しています。しかし、iOS6 の場合、次の向きの問題が発生しています。
私はViewController VC1を持っています。回転すると (向きを UIInterfaceOrientationLandscapeRight に変更します)、別の ViewController VC2 を提示したいのですが、元に戻すと、VC2 を閉じる必要があり、VC1 は縦長モードにする必要があります。
アプリケーションで tabBar を使用していますが、この機能は最初のタブにのみ必要です。
tabBar で私が書いた
-(BOOL) shouldAutorotate
{
UINavigationController *nav = (UINavigationController *)self.selectedViewController;
if ([nav.topViewController isKindOfClass:[MainViewController class]])
{
return YES;
}
else
{
return NO;
}
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
//Here I am writing code for presenting view(using notifications)
// but When I rotate the device to landscape it's getting called but when I rotate back
//to portrait I not getting called.
}
ありがとうございました。