iOS AppDelegate里各个代理函数的意义

//启动基本完成程序准备开始运行
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    return YES;
}

//当应用程序将要进入非活动状态.在此期间,应用程序不接收消息或事件,比如来电话了.
- (void)applicationWillResignActive:(UIApplication *)application {}

//当程序被推送到后台的时候调用。所以要设置后台继续运行,则在这个函数里面设置即可
- (void)applicationDidEnterBackground:(UIApplication *)application {}

//当程序从后台将要重新回到前台时候调用
- (void)applicationWillEnterForeground:(UIApplication *)application {}

//当应用程序进入活动状态执行
- (void)applicationDidBecomeActive:(UIApplication *)application {}

//当程序将要退出是被调用,通常是用来保存数据和一些退出前的清理工作。这个需要要设置UIApplicationExitsOnSuspend的键值
- (void)applicationWillTerminate:(UIApplication *)application {}

//请求委托打开一个 URL资源
- (BOOL) application:(UIApplication *) application handleOpenURL:(NSURL *)url{}

//请求委托打开一个 URL资源
- (BOOL) application:(UIApplication *) application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{}

//当内存低告警时
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application{}

//当应用程序即将终止时调用,可以在applicationDidEnterBackground中保存数据
-(void)applicationSignificantTimeChange:(UIApplication *)application{}

//当一个运行着的应用程序收到一个远程的通知发送到此方法 7.0之前
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{}

//当一个运行着的应用程序收到一个远程的通知 发送此方法 7.0之后
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{}

//当一个应用程序成功的注册一个推送服务(APS) 发送此方法 
-(void) application :(UIApplication *) application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken{}

//当 APS无法成功的完成向程序进程推送时 发送此方法 
-(void) application :(UIApplication *) application didFailToRegisterForRemoteNotificationsWithError:(NSError *) error{}

//当一个运行着的应用程序收到一个本地的通知 发送此方法 
-(void) application :(UIApplication *) application didReceiveLocalNotification:(UILocalNotification *)notification{}

你可能感兴趣的:(iOS AppDelegate里各个代理函数的意义)