方法shouldAutorotateToInterfaceOrientation:
はNOT supported in iOS 6
. 非推奨です。あなたがココアでの作業を始めたばかりの初心者で、iOS 6 ではビュー コントローラーがめちゃくちゃで、iOS 5 では完全である理由を疑問に思っている場合に備えて、shouldAutorotateToInterfaceOrientation: はもうサポートされていないことを知っておいてください。それはそれでうまくいくかもしれませんXcode 4 to 4.3
がNOT work on Xcode 4.5.
Apple は、これをよりクリーンな方法で行うための新しい方法を提供しています。代わりに supportedInterfaceOrientations を使用してください。ビューコントローラーがサポートするすべてのインターフェイスの向き、インターフェイスの向きの値のマスクを返します。
UIInterfaceOrientationMask Enum:
これらの定数は、View Controller がサポートするインターフェイスの向きを指定するためのマスク ビットです。
typedef enum {
UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait),
UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft),
UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight),
UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown),
UIInterfaceOrientationMaskLandscape =
(UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
UIInterfaceOrientationMaskAll =
(UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown),
UIInterfaceOrientationMaskAllButUpsideDown =
(UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight),
} UIInterfaceOrientationMask;