iOS iPad故事板未被选中 [英] iOS iPad storyboard is not being selected

查看:100
本文介绍了iOS iPad故事板未被选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎Xcode 5没有选择将我的iPad故事板用于iPad设备,即使我指定了它。

It seems that Xcode 5 is not choosing to use my iPad storyboard for the iPad device even though i specified it.

这就是我告诉Xcode 5使用的方式iPad故事板:

This is how i told Xcode 5 to use iPad storyboard:


  • 我去了 General
  • $下的项目设置b $ b
  • 所选设备:通用

  • 然后我点击 iPad

  • 并在主界面中写入 MainStoryboard-iPad.storyboard

  • I went to project settings under General
  • Selected Devices: Universal
  • Then i clicked on iPad
  • And wrote MainStoryboard-iPad.storyboard in Main Interface

但由于某种原因,即使我对我的 MainStoryboard-iPad 故事板进行了更改当我尝试在iPad上运行时它没有显示。

But for some reason even though i make changes to my MainStoryboard-iPad storyboard its not being showed when i try to run it on an iPad.

我的项目中只有两个故事板

I only have two storyboards in my project

MainStoryboard-iPad.storyboard

MainStoryboard-iPad.storyboard


MainStoryboard.storyboard

MainStoryboard.storyboard

任何想法在这里可能出错?

Any ideas what could be wrong here?

哦顺便问一下,什么时候当我第一次拿到一个盒子问我一些关于复制的东西(我从来没有仔细阅读过)时,当选Universal。我只是点击了。不知道那个盒子实际上做了什么。

Oh by the way, when i selected Universal the first time i got a box asking me something about copying (i never read it that carefully). I just hit Yes. Not sure what that box actually did.

编辑

运行的代码我的AppDelegate.m

Code that runs in my AppDelegate.m

- (void)applicationDidBecomeActive:(UIApplication *)application {
        AppDelegate *app = [[UIApplication sharedApplication] delegate];
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        UIViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"mainStoryBoard"];

        UINavigationController *nvc = (UINavigationController*)self.window.rootViewController;
        app.window.rootViewController = ivc;
}


推荐答案

我刚刚遇到这一段时间以前。

I just encountered this a while ago.

这是您需要做的步骤:


  1. 确保部署信息 - >设备是通用

  2. 为iPad创建故事板(例如)MainStoryboard_iPad.storyboard

  3. 现在转到您的Infor .plist

  4. 为主故事板文件基本名称(iPad)添加行,并使用MainStoryboard_iPad作为字符串的值

  1. make sure the "Deployment Info" -> Devices is "Universal"
  2. Create a storyboard for iPad (e.g) MainStoryboard_iPad.storyboard
  3. now go to your Infor.plist
  4. add row for "Main storyboard file base name (iPad)" and use MainStoryboard_iPad as the value of the string

现在你很高兴!!!

希望这会有所帮助!
Godbless

Hope this helps! Godbless

这篇关于iOS iPad故事板未被选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆