我是 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).
我做了什么:
我尝试对比我创建为标签栏应用程序的另一个项目(它确实反映了我的情节提要更改),但没有任何见解.
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 - 请注意,主/明细模板还为您提供了核心数据选项.
ALSO - note that the Master/Detail template also gives you a core data option.
这篇关于Xcode 4.2 iOS 空应用程序和故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!