古いバージョンの Xcode で作成されたアプリがあります。現在、Xcode 4.6.1 を使用しています。これは、社外で開発された別の開発者から継承したアプリです。
このアプリの問題の 1 つは、そのインターフェイスです。デフォルトは LandscapeLeft です (これは pList ファイルで設定された値です)。アプリはこのディレクティブを無視し、代わりに縦向きモードをデフォルトに設定します。
コードにこの値を強制的に適用させるために必要なことはありますか? 私はiOS/Objective-Cに比較的慣れていません。コードはコンパイルされて実行されますが、インターフェースが私が望んでいることをしていないだけです。
これはiPad専用アプリなので、少し簡単です。
編集 問題のあるviewControllerの1つに次のコードを追加しようとしましたが、受け入れられません。このビューを強制的に横向きにする方法について何か考えはありますか? (IDE に設定はありますか? Xcode には向きの属性があったようですが、4.6.1 では見つかりません)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return ((interfaceOrientation==UIInterfaceOrientationMaskLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationMaskLandscapeRight));
}
- (NSUInteger) supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (NSInteger) supportedInterfaceOrientationsForWindow
{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL) shouldAutoRotate
{
return YES;
}