我正在使用 Xcode 11并为 iOS 13建立一个应用程序。在我在 Xcode 创建的一个新项目中,一些用户界面应用/代理方法丢失了,所以我把它们重新添加到应用程序代理文件中。“单视图应用程序”项目的新模板缺少方法。问题是,除了 -application:didFinishLaunchingWithOptions:
之外,没有一个委托方法被调用。下面是我的应用程序代表:
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSLog(@"application:didFinishLaunchingWithOptions:");
return YES;
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"applicationDidEnterBackground:");
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"applicationWillEnterForeground:");
}
#pragma mark - UISceneSession lifecycle
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
}
@end