如果这不是提出此类问题的正确论坛,请指出正确的论坛。
我正在处理的应用使用用户的位置,并在满足某些条件时提醒用户。警报以振动和小文件的播放形式出现。在设备上测试期间,手机振动并且音频剪辑播放2秒钟(剪辑长约9秒)并且应用程序崩溃。崩溃在设备上是一致的。在模拟器上,偶尔会看到崩溃但不一致。
引发警报的触发器位于CLLocation类的委托方法中 - (void)locationManager:manager didUpdateToLocation:fromLocation:
这是代码片段(ivLocMgr是一个实例变量)
if ((!ivAlertAlreadyShown) && (<test for trigger condition)) {
ivAlertAlreadyShown = YES;
[self obviousNotification];
[ivLocMgr stopUpdatingLocation];
[ivLocMgr release], ivLocMgr = nil;
}
[ivLocMgr stopUpdatingLocation]可以;是根本原因?
非常感谢任何和所有帮助。 -S -
Incident Identifier: 8875BB08-4DAD-4FC7-8DC6-AA5D52D6FC78
CrashReporter Key: f995a257bad99baa2fcf0f7d5b0ab3e77dce3a91
Hardware Model: iPhone2,1
Process: SAlert [360]
Path: /var/mobile/Applications/D3B5BAED-036C-4CFE-A735-A61D6ECCDAF6/SAlert.app/SpAlert
Identifier: SAlert
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-08-30 07:35:41.206 -0700
OS Version: iPhone OS 4.2.1 (8C148a)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x46924508
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3199f464 objc_msgSend + 16
1 CoreLocation 0x30e1f430 -[CLLocationManager onClientEventLocation:] + 560
2 CoreLocation 0x30e1d68e -[CLLocationManager onClientEvent:supportInfo:] + 98
3 CoreLocation 0x30e1d804 OnClientEvent + 16
4 CoreLocation 0x30e19522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
5 CoreLocation 0x30e1b3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
6 CoreLocation 0x30e1b512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
7 CoreFoundation 0x314913fe __CFMessagePortPerform + 242
8 CoreFoundation 0x314656f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x314656bc __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x31457f76 __CFRunLoopRun + 514
11 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
12 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
13 GraphicsServices 0x35d664a4 GSEventRunModal + 108
14 GraphicsServices 0x35d66550 GSEventRun + 56
15 UIKit 0x338d5322 -[UIApplication _run] + 406
16 UIKit 0x338d2e8c UIApplicationMain + 664
17 StopAlert 0x00002f76 0x1000 + 8054
18 StopAlert 0x00002f40 0x1000 + 8000
Thread 1:
0 libSystem.B.dylib 0x31192974 kevent + 24
1 libSystem.B.dylib 0x3123c704 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x3123c174 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x3123bb98 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x311e024a _pthread_wqthread + 258
5 libSystem.B.dylib 0x311d8970 start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 WebCore 0x33d9f124 RunWebThread(void*) + 332
7 libSystem.B.dylib 0x311df886 _pthread_start + 242
8 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 3:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 Foundation 0x31cf15f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7 Foundation 0x31ccf192 -[NSThread main] + 38
8 Foundation 0x31cc8242 __NSThread__main__ + 966
9 libSystem.B.dylib 0x311df886 _pthread_start + 242
10 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 4:
0 libSystem.B.dylib 0x3118a68c select$DARWIN_EXTSN + 20
1 CoreFoundation 0x3148f662 __CFSocketManager + 582
2 libSystem.B.dylib 0x311df886 _pthread_start + 242
3 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 5:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 MapKit 0x347a2906 TileCachePrivate::runCacheThread() + 274
7 MapKit 0x347a27ea _runCacheThread(void*) + 2
8 libSystem.B.dylib 0x311df886 _pthread_start + 242
9 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 6:
0 libSystem.B.dylib 0x311de9f0 __semwait_signal + 24
1 libSystem.B.dylib 0x311937ec _pthread_cond_wait + 748
2 libSystem.B.dylib 0x311933d2 pthread_cond_wait + 26
3 QuartzCore 0x30a925dc CA::DispatchGroup::thread(void*) + 84
4 QuartzCore 0x30a5f01a thread_fun + 10
5 libSystem.B.dylib 0x311df886 _pthread_start + 242
6 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 7:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 libSystem.B.dylib 0x3118af5a thread_policy + 118
3 libSystem.B.dylib 0x3118aed2 pthread_setschedparam_internal + 62
4 libSystem.B.dylib 0x3118ae0e pthread_setschedparam + 70
5 TextInput 0x31e8128a KB::kb_set_thread_priority(int) + 18
6 TextInput 0x31e71f74 KB::BackgroundLoad(void*) + 84
7 libSystem.B.dylib 0x311df886 _pthread_start + 242
8 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x0403000f r1: 0x33baf8ef r2: 0x30e4bff6 r3: 0x00000001
r4: 0x46924500 r5: 0x30e1d7f5 r6: 0x00a01c64 r7: 0x2fdfec44
r8: 0x00000000 r9: 0x040fc098 r10: 0x00000000 r11: 0x00000000
ip: 0x3e16c584 sp: 0x2fdfeaa0 lr: 0x30e1f437 pc: 0x3199f464
cpsr: 0x200f0030
答案 0 :(得分:1)
在Apple开发者论坛上找到答案:
I needed to set the coreLocation instance's delegate to nil, when the alarm was triggered.
答案 1 :(得分:0)
没有足够的代码来正确确定中止的原因。您收到的错误告诉您正在尝试访问已发布的变量。我会从那里开始,确保你没有在那里发布你的位置经理或其他变量。