handleEventsForBackgroundURLSession"); } 当进入后台,想继续进行操作,如果没有注册后台任务,可实现如下代码: 先定义一个后台任务标识:UIBackgroundTaskIdentifier backgroundTaskIdentifier void)applicationDidEnterBackground:(UIApplication *)application { // 若不实现该代码,进入后台,不会响应定时器事件 backgroundTaskIdentifier %d", a++); } - (void)endBackgroundTask { [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskIdentifier ]; backgroundTaskIdentifier = UIBackgroundTaskInvalid; } 监听进程被杀死时,会发现, 程序处于前台被杀死时会调用applicationWillTerminate