iOS7: background task (“myapp” has active assertions beyond permitted time)

前端 未结 1 1927
甜味超标
甜味超标 2020-12-18 13:21

crash report detail :

Hardware Model:      iPhone5,2
Exception Type:  00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread:  3

Application Spec         


        
1条回答
  •  梦毁少年i
    2020-12-18 13:52

    This message indicates that your background task ran for too long. iOS7 has changed some aspects of background processing. In particular a background task should complete in a short amount of time and if it doesn't your app is terminated. You need to look at how your background tasks are operating. In particular, you need to ensure that you call [[UIApplication sharedApplication] endBackgroundTask:task]; in a timely manner. You should also call this method in your expiration handler.

    Have a look at the Background Execution and Multitasking section in the Apple iOS App Programming Guide Background Execution Guide.

    Additionally, you can check [[UIApplication sharedApplication]backgroundTimeRemaining] - on iOS 6 this started at 10 minutes. In iOS 7 it starts at 3 minutes - which is why you are getting timed out after 180 seconds. You need to re-evaluate your background strategy to deal with the new limit.

    0 讨论(0)
提交回复
热议问题