zoukankan      html  css  js  c++  java
  • AppDelegate.m默认方法的作用

    应用程序委托的主要作用是提供呈现应用程序内容的窗口,在应用程序呈现之前,应用程序委托也执行一些配置任务。

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    // Override point for customization after application launch.
    return YES;
    }
    //在应用程序起来时执行。我的理解是这里用来加载初始窗口界面。

    - (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 throttle down OpenGL ES frame rates. 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 inactive 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:.
    */
    }
    //在应用程序关闭时执行,主要用于保存数据。

  • 相关阅读:
    OpenCV学习(10) 图像的腐蚀与膨胀(1)
    OpenCV学习(6) 文件和Mat之间的数据交换
    OpenCV学习(5) Mat的基本操作(2)
    OpenCV学习(4) Mat的基本操作(1)
    OpenCV学习(3) OpenCV框架
    OpenCV学习(2) OpenCV的配置
    OpenCV学习(1) OpenCV的安装
    Android触控屏幕Gesture(GestureDetector和SimpleOnGestureListener的使用教程) 分类:Androidandroid实例
    转载 C++实现的委托机制
    C++如何禁止掉对象的复制操作
  • 原文地址:https://www.cnblogs.com/nanoCramer/p/2913177.html
Copyright © 2011-2022 走看看