首页 前端 ios 正文

XCode12删除SenceDelegate黑屏问题

long 2021-02-05 14:20 ios 人气251

使用xcode12开发的时候,建项目的时候,带了SenceDelegate文件,这个文件必须是ios13以后才能使用。我想开发ios9/ios10能用的应用。所以必须删除SenceDelegate。

方法如下:

1、删除SenceDelegate.h,SenceDelegate.m。

2、删除info.list里的Application Scene Manifest。

3、删除AppDelegate.m里的Sence相关代码

- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}


- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}

4、在AppDelegate.h里增加window

@property(nonatomic, strong) UIWindow * window;

原文连接:https://cloud.tencent.com/developer/article/1658576
公众号
小程序
网站统计
  • 文章总数:296
  • 总点击量:53712
  • 评论总数:27
  • 网站运行:543 天