新情況
更新到XCode11之后,老項(xiàng)目沒關(guān)系,但是新建項(xiàng)目,和以前完全不一樣了。增加了SceneDelegate,據(jù)說是為了iPad的多進(jìn)程準(zhǔn)備的。

image.png
AppDelegate.m中增加了關(guān)于SceneDelegate的函數(shù)。
#pragma mark - UISceneSession lifecycle
- (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.
}
去掉不需要的SceneDelegate
如果沒有多進(jìn)程需求,那么還是去掉這個(gè)多余的SceneDelegate比較好。
直接刪除
SceneDelegate文件,包括.h,.m刪除
info.plist中的Application Scene Manifest選項(xiàng)刪除
AppDelegate.m中關(guān)于SceneDelegate的函數(shù)。在
AppDelegate.h中添加window屬性
@property (strong, nonatomic) UIWindow *window;
沒有
window屬性,會(huì)導(dǎo)致黑屏
- 設(shè)置最低支持版本,比如9.0;最好不要用8.0,太低了,有未知的問題。

image.png
多進(jìn)程等以后成熟了再說,并且最低支持版本最好是iOS13