美文网首页
Xcode11 新建工程

Xcode11 新建工程

作者: 遇见I你 | 来源:发表于2019-11-15 17:55 被阅读0次

    还原Xcode11版本之前的项目工程配置:

    Signing & Capabilities 选择可以配置Bundle Identifier 和 Team

    1.删除工程根目录下的SceneDelegate(.h和.m)文件

    img1.png

    2. AppDelegate.h中添加 window属性

    @interface AppDelegate : UIResponder <UIApplicationDelegate>

    @property (strong, nonatomic) UIWindow * window;

    @end

    3. AppDelegate.m 中添加application生命周期函数

    - (void)applicationWillResignActive:(UIApplication *)application {

        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.

    }

    - (void)applicationDidEnterBackground:(UIApplication *)application {

        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

    }

    - (void)applicationWillEnterForeground:(UIApplication *)application {

        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.

    }

    - (void)applicationDidBecomeActive:(UIApplication *)application {

        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

    }

    - (void)applicationWillTerminate:(UIApplication *)application {

        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

    }

    4.删除info.plist文件中的 Application Scene Manifest 

    img2.png

    5.修改main.m中的main函数代码

    int main(int argc,char* argv[]) {

        @autoreleasepool {

            return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

        }

    }

    相关文章

      网友评论

          本文标题:Xcode11 新建工程

          本文链接:https://www.haomeiwen.com/subject/vwmsictx.html