Xcode 5模拟器空白屏幕 [英] Xcode 5 Simulator Blank White Screen
问题描述
我刚刚安装了Xcode 5(或最新版本)并创建了一个新项目.我创建了一个情节提要,并添加了一个标签,但是当我在iPhone模拟器中打开应用程序时,我只是得到了一个空白的空白屏幕和一个状态栏.我在做什么错了?
I just installed Xcode 5 (or the latest version) and created a new project. I created a storyboard, and added a label, but when I open my application in the iPhone simulator, I simply get a blank white screen with a status bar. What am I doing wrong?
我有OS X 10.9.1 Mavericks.
I have OS X 10.9.1 Mavericks.
推荐答案
I know I'm quite late to this, but the solution to this problem is quite simple and is even shown in one of Apple's own tutorials.
假设您从空项目"开始,从头创建了一个情节提要,并将情节提要设置为主要界面,则需要在AppDelegate.m的第一种方法中删除几行.
Assuming that you started off with an "Empty Project", created a storyboard from scratch, and set your storyboard as the main interface, you need to remove a few lines in the first method of AppDelegate.m.
此:
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;
应该变成这样:
return YES;
这篇关于Xcode 5模拟器空白屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!