2012-06-26 26 views
0

的崩潰報告的細節:應用程序崩潰,因爲超出了允許的時間積極斷言

Exception Type: 00000020 
Exception Codes: 0x8badf00d 
Highlighted Thread: 3 

Application Specific Information: 
MyApp[123] has active assertions beyond permitted time: 
{(
    <SBProcessAssertion: 0x4b52f0> identifier: CoreLocationBackgroundClient process: MyApp[579] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:123 preventSuspend preventIdleSleep 
)} 

Elapsed total CPU time (seconds): 13.980 (user 13.980, system 0.000), 1% CPU 
Elapsed application CPU time (seconds): 0.251, 0% CPU 

和線程3:

Thread 3 name: com.apple.NSURLConnectionLoader 
Thread 3: 
0 libsystem_kernel.dylib   0x30e67004 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x30e671fa mach_msg + 50 
2 CoreFoundation     0x381ea3ec __CFRunLoopServiceMachPort + 120 
3 CoreFoundation     0x381e9124 __CFRunLoopRun + 876 
4 CoreFoundation     0x3816c49e CFRunLoopRunSpecific + 294 
5 CoreFoundation     0x3816c366 CFRunLoopRunInMode + 98 
6 Foundation      0x373a7bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302 
7 Foundation      0x373a7a7a -[NSThread main] + 66 
8 Foundation      0x3743b58a __NSThread__main__ + 1042 
9 libsystem_c.dylib    0x333c972e _pthread_start + 314 
10 libsystem_c.dylib    0x333c95e8 thread_start + 0 

應用程序使用GPS。任何想法爲什麼這個崩潰發生?

+0

可能重複的[iPhone應用程序「具有超出允許時間的主動斷言」](http://stackoverflow.com/questions/3654716/iphone-app-has-active-assertions-beyond-permitted-time) – rishi

+0

@ rishi 。這是我第一次面對這個問題。你可以檢查我的舊問題。 – Perseus

+0

我剛剛給出了與您的問題完全相同的問題鏈接,我希望這可以幫助您解決問題。沒有難過的感覺! – rishi

回答

1

看起來好像您正在使用錯誤的背景處理類型。 600秒是放棄。這表明您正在使用任務完成API,該API可爲應用程序提供有限的時間(當前爲10分鐘),以在特定活動被暫停之前完成。

如果您想要在後臺繼續監控GPS位置,則需要使用特定的Core Location API(並在Info.plist中設置相應的標誌)。

+0

嗨,我已經使用所需的背景模式作爲定位服務(GPS)進行後臺處理。當應用程序處於後臺時,任務工作良好。我突然發生這樣的崩潰,我已經關閉了我的應用程序GPS並嘗試做一些任務。我猜在NSURLConnection中有一些問題 – Perseus

+0

嗨,我在後臺使用NStimer併發送http請求並處理它,但它認爲這個錯誤可以幫助我嗎? –

+0

@JigneshB這聽起來像一個新問題。位置服務是iOS上的特例。 NSTimer將無法工作超過十分鐘,因此您需要執行諸如後臺提取等操作。 –

相關問題