美文网首页iOSiOS学习程序员
UI-对AppDelegate.m中方法简介的翻译

UI-对AppDelegate.m中方法简介的翻译

作者: Go_Spec | 来源:发表于2016-03-29 22:27 被阅读348次

    将注释看明白后对以后的学习很有帮助,注释中不仅有专业的解释,还有对一些用户使用情况的举例,很形象直观!

    1.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

    {

    // Override point for customization after application launch.

    翻译:APP启动后的自定义点

    解释:APP启动后会走这个方法

    }

    2.

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

    // Sent when the application is about to move from active to inactive state.

    翻译:在APP即将从活跃状态转换到非活跃状态时要发送此消息

    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.

    翻译:有如下几种会临时打断程序活跃运行状态的情况:(比如突然的呼入电话或接收到的短讯息)或当用户退出APP后,程序就会自行转换到后台运行时的状态

    // 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.

    翻译:使用此方法来暂停运行中的任务,使timer暂时停止工作,放缓OpenGL ES的帧频.如果是游戏则应该使用这个方法来暂停游戏.

    解释:APP即将进入非活跃状态时会走这个方法

    }

    3.

    - (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.

    翻译:使用此方法来释放共享资源,保存用户数据,撤销计时器,并且储存足够的可以使您的APP重新恢复到当前状态的程序状态信息,以防程序被终止后发生数据丢失.

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

    翻译:如果您的APP支持后台运行,这个方法可以成为applicationWillTerminate方法的替代方法

    解释:程序进入后台时会走这个方法

    }

    4.

    - (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.

    翻译:此方法是APP由后台转换到非活跃状态过程的一部分;在这里你可以撤销APP在进入后台运行时做过的操作

    解释:程序回到前台时会走这个方法

    }

    5.

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

    // Restart any tasks that were paused (or not yet started) while the application was inactive.

    翻译:可以重新运行在APP进入非活跃状态时暂停(或还没开始的)任何任务

    If the application was previously in the background, optionally refresh the user interface.

    翻译:如果app还在后台运行,视情况可以时刷新用户界面

    解释:程序恢复活跃状态时会走这个方法

    }

    6.

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

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

    翻译:此方法会在程序即将关闭时被调用.它会在恰当的时候存储数据.查看app是否结束运行(或进入后台运行状态).

    解释:程序即将退出时会走这个方法

    }

    相关文章

      网友评论

        本文标题:UI-对AppDelegate.m中方法简介的翻译

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