1.获取window
UIWindow * window = [UIApplication sharedApplication].keyWindow;
2.删除系统的storyboard和viewcontroller显示黑屏
1.检查项目中的TARGETS---Main Interface 是否为空
只有为空才行
2.检查Info.plist文件 中是不是还有Main 这个属性 如果有 请删除
3.必须在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = xxxx;
[self.window makeKeyAndVisible];
}
3.设置启动图片的时候没有显示
0.前提你已经在 Assets.xcassets 里面添加了LaunchImage 并且尺寸是吻合的
1.检查LaunchScreen.storyboard是否勾选了User Launch Screen
如果是勾选 请你把它去除
2.检出项目中的TARGETS -- App Icons and LaunchImage 中的 Launch Images Source 和 Assets.xcassets 是否名字吻合
4.在iOS9以后,苹果要求网络请求使用https,但是很多网络框架都还是http的,所以应该在项目的info.plist文件中配置一下。
具体方法如下:
在Info.plist中添加AppTransportSecuritySettings类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES