Xcode 4.2 iOS空应用程序和故事板 [英] Xcode 4.2 iOS Empty Application and storyboards

查看:106
本文介绍了Xcode 4.2 iOS空应用程序和故事板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Xcode的新手,我正在尝试制作我的第一个培训应用程序。由于显然空应用程序模板是唯一提供预集成核心数据的模板,我选择它。然而,在那之后,我无法让UI工作(它仍然是空的)。

I'm an Xcode newbie, and I'm trying to make my first training app. Since apparently Empty Application template is the only template that offers pre-integrated Core Data, I choose that. However, after that, I can't get UI to work (it remains empty).

我做了什么:


  • 空应用程序模板

  • 新iPad故事板文件

  • 将标签栏控制器溅到其上

  • 在项目摘要视图中更改主要故事板

  • 点击⌘R

  • 盯着纯白色iPad屏幕,没有任何标签

  • Empty Application template
  • New iPad Storyboard file
  • Splashed Tab Bar Controller onto it
  • Changed Main Storyboard in Project's Summary view
  • Hit ⌘R
  • Stared at pure-white iPad screen, without any tabs

我尝试将我作为标签栏应用程序创建的另一个项目进行区分(这确实反映了我的Storyboard更改) ),没有任何见解。

I tried diffing against another project that I created as a Tab Bar Application (which does reflect my Storyboard changes), without any insight.

推荐答案

在AppDelegate.m中注释(或删除)窗口创建和显示代码,如下所示:

Comment out (or remove) the window creation and display code in AppDelegate.m as follows:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    // self.window.backgroundColor = [UIColor whiteColor];
    // [self.window makeKeyAndVisible];

    return YES;
}

使用故事板时,会自动为您创建主UIWindow。在您的情况下发生的是您正在创建另一个白色窗口并将其放在选项卡UI的顶部。

When using a storyboard, a main UIWindow is created for you automatically. What is happening in your case is that you are creating another white window and putting it over the top of the tab UI.

- 注意主/明细模板也为您提供核心数据选项。

ALSO - note that the Master/Detail template also gives you a core data option.

这篇关于Xcode 4.2 iOS空应用程序和故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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