我想每分钟调度applicationDidEnterBackground方法,以便我可以调用服务器?

时间:2016-02-20 19:41:03

标签: ios objective-c

  • (void)applicationWillEnterForeground:(UIApplication *)application { //这里我想在每分钟后调用服务器。 //当我的应用程序最小化 }

1 个答案:

答案 0 :(得分:1)

这不是一个你应该调用的方法 - 例如,当你离开应用程序到主屏幕时,它就是一个自动调用的方法。你需要的是一个预定的后台任务 - 它是一个相当大的区域,在本文档中由苹果覆盖:https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html