当用户对表视图进行编辑并且数据在其中刷新时,应用程序崩溃

时间:2010-10-09 16:25:10

标签: cocoa nstableview

在我的应用程序中,我已经采用了某些表视图,如果用户进行并保存更改,它们的数据将在后台线程中刷新。

问题是 -

  

当用户对a进行一些编辑时   表行及其数据将被刷新   在后台,由于所做的更改   其他一些用户,然后是应用程序   崩溃。

有人能建议我一些解决方案吗?

以下是崩溃报告的部分:

Process:         RCS [153]

Path:            /Applications/RCS.app/Contents/MacOS/RCS
Identifier:      com.tprf.RCS

Version:         1.5.10 build-0212 (1.5.10)
Code Type:       X86 (Native)
Parent Process:  launchd [96]

Date/Time:       2010-10-07 11:40:15.595 -0700
OS Version:      Mac OS X 10.6.4 (10F569)
Report Version:  6

Interval Since Last Report:          297915 sec
Crashes Since Last Report:           2
Per-App Interval Since Last Report:  213604 sec
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      4037E18D-81EF-461F-95D5-9E7D7C5701A6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c0e9bb1a
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: objectForKey:


Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x97a4aedb objc_msgSend + 27
1   com.apple.AppKit                0x90c558ec -[NSTableView _delegateWillDisplayCell:forColumn:row:] + 62
2   com.apple.AppKit                0x90bd29f5 -[NSTableView preparedCellAtColumn:row:] + 1362
3   com.apple.AppKit                0x90becacc -[NSTableView _drawContentsAtRow:column:withCellFrame:] + 56
4   com.apple.AppKit                0x90bebb3a -[NSTableView drawRow:clipRect:] + 1131
5   com.apple.AppKit                0x90beb572 -[NSTableView drawRowIndexes:clipRect:] + 360
6   com.apple.AppKit                0x90be9f4b -[NSTableView drawRect:] + 1144
7   com.apple.AppKit                0x90bdfa36 -[NSView _drawRect:clip:] + 3510
8   com.apple.AppKit                0x90bde6d4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1600
9   com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
10  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
11  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
12  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
13  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
14  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
15  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
16  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
17  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
18  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
19  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
20  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
21  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
22  com.apple.AppKit                0x90bdea09 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2421
23  com.apple.AppKit                0x90bdcbf3 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 711
24  com.apple.AppKit                0x90bdc767 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 265
25  com.apple.AppKit                0x90bd90ae -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 3309
26  com.apple.AppKit                0x90b39d3f -[NSView displayIfNeeded] + 818
27  com.apple.AppKit                0x90b03050 -[NSWindow displayIfNeeded] + 204
28  com.apple.AppKit                0x90b34572 _handleWindowNeedsDisplay + 696
29  com.apple.CoreFoundation        0x996812c2 __CFRunLoopDoObservers + 1186
30  com.apple.CoreFoundation        0x9963d9bd __CFRunLoopRun + 557
31  com.apple.CoreFoundation        0x9963d094 CFRunLoopRunSpecific + 452
32  com.apple.CoreFoundation        0x9963cec1 CFRunLoopRunInMode + 97
33  com.apple.HIToolbox             0x905ecf9c RunCurrentEventLoopInMode + 392
34  com.apple.HIToolbox             0x905ecc8d ReceiveNextEventCommon + 158
35  com.apple.HIToolbox             0x905ecbd6 BlockUntilNextEventMatchingListInMode + 81
36  com.apple.AppKit                0x90b0aa89 _DPSNextEvent + 847
37  com.apple.AppKit                0x90b0a2ca -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
38  com.apple.AppKit                0x90acc55b -[NSApplication run] + 821
39  com.apple.AppKit                0x90ac45ed NSApplicationMain + 574

谢谢,

Miraaj

1 个答案:

答案 0 :(得分:1)

崩溃日志说:

Application Specific Information:
objc_msgSend() selector name: objectForKey:

这意味着您在尝试发送objectForKey:消息时崩溃了。

从崩溃日志中不清楚这是您的tableView:willDisplayCell:forTableColumn:row:实现崩溃,还是NSTableView查找内容以发送该委托消息。如果它是前者,那么你可能不会保留或复制你应该的字典。如果是后者,那么你可能不会保留作为表视图委托的对象。

无论哪种方式,Instruments中的Zombies模板都会告诉您它尝试向哪个对象发送消息,以及该对象收到的释放和自动释放消息。从那里,您可以确定哪个版本或自动发布消息是过多的消息(如果有的话),或者应该保留该对象的哪个对象不是。