Xcodeを4.5に更新し、以下のようにオリエンテーションメソッドを実装しました
-(BOOL)shouldAutorotate{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}
willRotateToInterfaceOrientationメソッドでボタン、ラベル、画像のフレームサイズを設定しています
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait )||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown ))
{
// set frame sizes for portait
}
else if(( [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft )||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight ))
{
// set frame sizes for landscape
}
}
ただし、シミュレーターを回転させているときにこのメソッドが呼び出されない場合や、別のviewControllerからナビゲートしているときにシミュレーターが方向を検出しない場合があります。info.plistファイルを確認しました-問題ありません。