Xcode6 找回 Empty Application 模版

Alt none

Xcode6取消了 “Empty Application”的模版,但是有时候我们还是有创建”Empty Application”的需求,可以按如下步骤来实现:

经过以上步骤后,你会发现编译失败,因为找不到Main.storyboard,我们还需要修改一下

info.plist中的配置:

Alt none

删除Main storyboard file base name 后再次编译,这次可以成功运行,但是屏幕显示的是黑屏。

打开AppDelegate.m修改application:didFinishLaunchingWithOptions:方法:

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