Could not find a storyboard named 'Main' in bundle NSBundle
2016-06-23 09:54
441 查看
xcode6中,因为不想用 storyboard,然后就把创建工程时,默认的 storyboard 给删除了,结果碰到了这种情况,报错是这样的
百度了一下,解决方法是这样的,删掉工程中main.storyboard 后要删除plist文件中对应的键值就可以了
然后在 AppDelegate 里面设置一个 window
.h 文件
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
.m 文件
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
还有一种情况是我除了删除 stroyboard,还删除了默认的LaunchScreen.xib,删除了这个文件后导致了什么问题呢,就是在屏幕上面和下面留有黑边。
最后找到了一种解决方案添加一张(640*1136)启动图片: Default–568h@2x.png,
不过还有就是你可以新创建一个工程,然后把那个工程的LaunchScreen.xib文件复制过来,在项目设置的 General选项里面,把 Launch Screen File 选择为这个 xib 文件就可以了
百度了一下,解决方法是这样的,删掉工程中main.storyboard 后要删除plist文件中对应的键值就可以了
然后在 AppDelegate 里面设置一个 window
.h 文件
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
.m 文件
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
还有一种情况是我除了删除 stroyboard,还删除了默认的LaunchScreen.xib,删除了这个文件后导致了什么问题呢,就是在屏幕上面和下面留有黑边。
最后找到了一种解决方案添加一张(640*1136)启动图片: Default–568h@2x.png,
不过还有就是你可以新创建一个工程,然后把那个工程的LaunchScreen.xib文件复制过来,在项目设置的 General选项里面,把 Launch Screen File 选择为这个 xib 文件就可以了
相关文章推荐
- Maven打包带main函数的jar
- CONTAINING_RECORD
- CreateWaitableTimer和SetWaitableTimer函数
- 80老翁谈人生(12):强烈呼吁高校招生系统引进人工智能(机器人)
- 用正则表达式提取单个页面文件里Email地址的简单实现
- NSSearchPathForDirectoriesInDomains用法,程序目录结构
- Hadoop YARN配置参数—Fair Scheduler相关参数
- chinapub读书会第10期:机器学习与人工智能 6月25日相约阿里云+优客工场
- 简单leetcode(五)
- Shiro-1.2.2内置的FilterChain
- STL之关联容器(pair、map、set的使用)
- Failed to load class "org.slf4j.impl.StaticLoggerBinder"问题解决fangan
- [Webpack 2] Maintain sane file sizes with webpack code splitting
- 即使jarsigner 后,有些机型还是会安装不上,报错INSTALL_PARSE_FAILED_NO_CERTIFICATES
- 详解ABP框架中领域层的领域事件Domain events
- RHEL7 RAID10+LVM 延续了一下前面的实验同时添加了LVM的内容
- 正则表达式工具RegexBuddy使用教程(原创自Zjmainstay)
- "人工智能之父"马文・明斯基 - 阮一峰的网络日志
- Flash media server下main.asc 如何生成main.far
- GoldenGate配置PUMP进程和本地TRAIL路径的同步