2013-03-19 12 views
5

iPhone用のアプリを作成しました。このアプリをanswerの手順に従ってiPadに変換したかったのです。iPadシミュレータ/デバイスはiPhoneのストーリーボードを使用

  • あなたのiPhone、ストーリーボードを複製し、それがこのファイルに任意のテキストエディタを開き

  • をMainStoryboard_iPad.storyboard名前を変更します。

  • targetRuntime = "iOS.CocoaTouch" を検索するとtargetRuntime = "iOS.CocoaTouch.iPad"

  • にそれを変更するには、今すぐにすべてを保存するとXcodeを再度開く - > iPadの-ストーリーボードは、iPhoneと同じが含まれています-fileしかしeverytingは、すべてが正しく行われているが、iPadのシミュレータ/デバイスはとにかくiPhoneのストーリーボードを使用しています

乱れることができます。助言がありますか?

私はiPadのストーリーボードをsummary-> ipad deployment info-> Main storyboardに設定しました。 main.plist->メインストーリーボードのファイル名(iPad)はiPadのストーリーボードに設定されています。

私には何が足りないのか教えてください。

UPD。面白いことに、iPadのストーリーボードの名前をipadのデプロイメント情報から削除すると、まだiPhoneのストーリーボードが使用されています。

enter image description here

enter image description here enter image description here

enter image description here

+0

をappDelegateで適切なストーリーボードを選択し、適切なルートビューコントローラを提示でき、あなたはXcodeのは、iPhoneのストーリーボードを使用して何を意味するのですか? iPadシミュレータ用にビルドすると、まだiPhoneのストーリーボードが使用されていますか? – danielrsmith

+0

yea、ipad simulator/deviceはiPhoneシミュレータを使用します – ignotusverum

+1

iOS Application Targetでは、DevicesはUniversalに設定されていますか? – danielrsmith

答えて

4

あなたは、常にプログラム的

@interface AppDelegate : UIResponder <UIApplicationDelegate> 
{ 
    UIViewController *rvc; 
} 

実装

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 
     UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IPAD_Storyboard" bundle:nil]; 
     rvc = [storyboard instantiateViewControllerWithIdentifier:@"identifierForController"]; 
    } 
    else { 
     UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil]; 
     rvc = [storyboard instantiateViewControllerWithIdentifier:@"identifierForController"]; 
    } 


    [self.window addSubview:rvc.view]; 
    self.window.backgroundColor = [UIColor whiteColor]; 
    [self.window makeKeyAndVisible]; 

    return YES; 
} 
+0

ありがとう、それはとにかくiPhoneのストーリーボードを使用しています – ignotusverum

+1

私はきれいにビルドされているし、今働いている、ありがとう – ignotusverum

+0

それはほとんどのxcode-y方法ではないが、あなたはそのルートで問題を抱えていたようだ:/、 –

4

いけないプロジェクトのInfo.plistファイル(メインストーリーボードファイルベース名/メインストーリーボードファイルベース名(アプリ))で、以下のものを追加することを忘れ

enter image description here

これが役に立ちます。

+0

に設定されています。info->メインストーリーボードのファイル名(iPad)はiPadのストーリーボードに設定されています。 – ignotusverum

+0

これはまさに私の問題でした。 Xcodeは、アプリをユニバーサルにアップグレードしたときに、メインのストーリーボードファイルのベース名(iPad)ではなく、メインnibファイルのベース名(iPad)をMain-iPad.storyboardに設定しました。 – Dustin

関連する問題