copy from -> https://blog.csdn.net/david412306524/article/details/50736461
================
在info.plist中去掉main storyboard file base name
每次使用Single View Application模板创建工程之后,总是会有一个Main.storyboard文件,那么,当我们使用代码布局的时候,很显然是不需要它的。那么,如何将它从工程中移除呢?只要进行如下几步即可。
image
在TARGETS中,将Main InInterface选项中的值清空并保存设置。
image
选择storyboard文件。将类关联文件项清空并保存设置。
image
从工程中移除文件。
- (BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
//Overridepointforcustomization after application launch.
self.window = [[UIWindowalloc]initWithFrame:[[UIScreenmainScreen] bounds]];
//Overridepointforcustomization after application launch.
ViewController*viewController = [[ViewControlleralloc] init];
self.window.rootViewController = viewController;
self.window.backgroundColor = [UIColorpurpleColor];
[self.window makeKeyAndVisible];
returnYES;
}
完成以上几步,运行工程即可,顺利运行,没有出现任何error或waring。