我試圖測試我的Mac OS應用程序,它在10.8上運行良好,但是當我開始在Mac 10.6.3(iatkos s3)上測試時,出現了一些問題。performSelectorInBackground:在Mac OS上立即崩潰x 10.6.3
首先,我必須使用單獨的計算機來安裝10.6.3,因爲我的MacBook Air不允許我安裝10.6.3(硬件比軟件更新)。我所做的是,在xcode中運行它,獲取.app文件,將它放到我的10.6.3應用程序文件夾中,然後運行它。
我把一些跟蹤日誌那裏,這裏是我的代碼:
- (void) startMethodInBackground: (id) sender {
NSLog(@"line 101"); //this shows
[self performSelectorInBackground:@selector(myOtherMethod:) withObject:sender];
NSLog(@"line 102"); //not showing
}
- (void) myOtherMethod: (id) sender {
NSLog(@"line 201"); //not showing
@autoreleasepool {
NSLog(@"line 202"); //again not showing
@synchronized (self) {
NSLog(@"line 203"); //not showing
... ...
}
}
}
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [1126]
Date/Time: 2013-02-28 16:53:10.668 -0500
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread: 2
... (too long so I trimmed it)
...
Thread 2 Crashed:
0 ??? 000000000000000000 0 + 0
1 com.apple.Foundation 0x00007fff814e4ead __NSThread__main__ + 1429
2 libSystem.B.dylib 0x00007fff86db38b6 _pthread_start + 331
3 libSystem.B.dylib 0x00007fff86db3769 thread_start + 13
Thread 2 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000100863400 rcx: 0x0000000000000000 rdx: 0x00000001001417b0
rdi: 0x00000001001417b0 rsi: 0x0000000000000000 rbp: 0x0000000100480c90 rsp: 0x0000000100480b08
r8: 0x0000000000000000 r9: 0x0000000100201530 r10: 0x0000000100210870 r11: 0x0000000100002120
r12: 0x00007fff5fbfe800 r13: 0x0000000000001b07 r14: 0x00007fff814e4918 r15: 0x0000000102e0ec20
rip: 0x0000000000000000 rfl: 0x0000000000010202 cr2: 0x0000000000000000
,你可以在我的代碼,只要我打電話myOtherMethod看到,:使用performSelectorInBackground :,墜毀!
所以我的問題是:
任何理由調用performSelectorInBackground崩潰?我檢查了performSelectorInBackground方法,它應該在10.6(蘋果文檔說10.5或更高版本)上正常工作,所以我真的必須發生什麼事情!
崩潰報告對我來說真的沒有意義,所以在現實生活中,你怎麼能用這樣的報告進行調試?在Xcode中,如果有任何問題,它會崩潰,並會告訴我哪種方法導致了問題和問題,但正如您所看到的,崩潰報告沒有告訴我太多!
任何幫助表示讚賞。 Josh
是否有可能您的對象被釋放? – paulmelnikow 2013-03-14 06:17:29