viewControllerを派生させて回転に対応させる | programmableのブログ

programmableのブログ

ブログの説明を入力します。

iOS6になってshouldAutrotateToInterfaceOrientationはDeprecatedになった。
そして、以下の2つのメソッドをオーバーライドすることによって
回転に対応できるようになる。

-(BOOL)shouldAutorotate{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}

また、回転方向はinfo.plistに設定することになる。