2013-12-16 107 views
2

任何人都可以幫助我解決這個崩潰。這發生在應用程序退出但不總是。應用程序崩潰退出

Application Specific Information: 
objc_msgSend() selector name: respondsToSelector: 
Performing @selector(terminate:) from sender NSMenuItem 0x34cfd0 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 
0 libobjc.A.dylib     0x979414cc objc_msgSend + 44 
1 com.apple.MyApp     0x00026d9f -[MyAppController applicationShouldTerminate:] + 398 
2 com.apple.AppKit    0x91086dc2 -[NSApplication _docController:shouldTerminate:] + 83 
3 com.apple.AppKit    0x91086cb4 __91-[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:]_block_invoke + 140 
4 com.apple.AppKit    0x910869c0 -[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 1304 
5 com.apple.AppKit    0x9108646b -[NSDocumentController(NSInternal) __closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 266 
6 com.apple.AppKit    0x91086103 -[NSApplication _shouldTerminate] + 760 
7 com.apple.AppKit    0x90f88008 -[NSApplication terminate:] + 1139 
8 libobjc.A.dylib     0x97957283 -[NSObject performSelector:withObject:] + 70 
9 com.apple.AppKit    0x90f2fd75 -[NSApplication sendAction:to:from:] + 438 
10 com.apple.AppKit    0x90f4c315 -[NSMenuItem _corePerformAction] + 486 
11 com.apple.AppKit    0x90f4c01a -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 163 
12 com.apple.AppKit    0x90f4b6c9 -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79 
13 com.apple.AppKit    0x90f4b675 -[NSMenu _performActionWithHighlightingForItemAtIndex:] + 48 
14 com.apple.AppKit    0x90f4b022 -[NSMenu performKeyEquivalent:] + 294 
15 com.apple.AppKit    0x90f47735 -[NSApplication _handleKeyEquivalent:] + 938 
16 com.apple.AppKit    0x90eb0cbe -[NSApplication sendEvent:] + 3911 
17 com.apple.AppKit    0x90cf56cc -[NSApplication run] + 823 
18 com.apple.AppKit    0x90cde558 NSApplicationMain + 1165 
19 com.apple.MyApp     0x00111c9a main + 728 
20 com.apple.MyApp     0x00002401 start + 53 

有些時候,我得到以下的崩潰日誌,當它崩潰在退出,這再次並不總是。

objc_msgSend() selector name: respondsToSelector: 
objc[33814]: garbage collection is OFF 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 
0 libobjc.A.dylib     0x99546d47 objc_msgSend + 23 
1 com.apple.MyApp     0x0001c574 -[MyAppController applicationShouldTerminate:] + 390 
2 com.apple.AppKit    0x915f6701 -[NSApplication _docController:shouldTerminate:] + 83 
3 com.apple.AppKit    0x917240ff __-[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:]_block_invoke_1 + 228 
4 com.apple.AppKit    0x91730f86 -[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 1693 
5 com.apple.AppKit    0x91729ec6 -[NSDocumentController(NSInternal) __closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 310 
6 com.apple.AppKit    0x915fdb15 -[NSApplication _shouldTerminate] + 889 
7 com.apple.AppKit    0x91334332 -[NSApplication terminate:] + 1219 
8 com.apple.CoreFoundation  0x90c1dd11 -[NSObject performSelector:withObject:] + 65 
9 com.apple.AppKit    0x914371ff -[NSApplication sendAction:to:from:] + 232 
10 com.apple.AppKit    0x9152ad8b -[NSMenuItem _corePerformAction] + 536 
11 com.apple.AppKit    0x9152aa08 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 171 
12 com.apple.AppKit    0x9152a091 -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79 
13 com.apple.AppKit    0x9152a03d -[NSMenu _performActionWithHighlightingForItemAtIndex:] + 48 
14 com.apple.AppKit    0x914a3923 -[NSMenu performKeyEquivalent:] + 306 
15 com.apple.AppKit    0x914a2392 -[NSApplication _handleKeyEquivalent:] + 594 
16 com.apple.AppKit    0x91397cef -[NSApplication sendEvent:] + 5772 
17 com.apple.AppKit    0x91329459 -[NSApplication run] + 1007 
18 com.apple.AppKit    0x915babf1 NSApplicationMain + 1054 
19 com.apple.MyApp     0x0010094b main + 216 
20 com.apple.MyApp     0x0000264d start + 53 
+0

向我們展示你的代碼在你實現'terminate:'方法的地方。 –

+0

@Virussmca:他陳述**並不總是**,如果它沒有實現,它將永遠是!!! –

+0

@AnoopVaidya:你在哪裏看**有時候**有問題?我已經看到了, –

回答

0

當然首先看看你的-[MyAppController applicationShouldTerminate:],假設你已經實現了。你可能指的是一個已經被釋放的對象(這是ARC嗎?這種錯誤的最常見原因是未能使用ARC。)

如果你還沒有實現applicationShouldTerminate:,你已經過度發佈了應用程序委託本身。 NSZombies可以幫助診斷。

+0

我沒有看到應用程序代表已發佈到哪裏 –