Menu Home

Xcode6: 找回”Empty Application”模版

4C2EF67B-9D90-4248-B007-926EAA5ADEEA

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

  • 删除ViewController.h和ViewController.m文件
  • 删除Main.storyboard
  • 删除LaunchScreen.xib

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

2

删除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;
}

Categories: IOS objective-c

Tagged as:

lnmcc

Leave a Reply

Your email address will not be published.