Skip navigation.
 
mlNSArrayController subclass crash
FROM : Jaime Magiera
DATE : Mon Feb 04 02:28:31 2008

Hello,

I've searched the archives, but haven't quite been able to narrow this 
down. I have a "parent" NSArrayController which provides values to a 
main window. A member of that controller's selected object is the 
source for a second array controller. That array is connected to a 
second window with a NSTableView. The second controller utilizes an 
NSArrayController subclass for default value purposes (using newObject).

NSArrayController1 [Tracks] -> NSArrayController2 [[NSArrayController1 
selectedObject] trackEvents]

-(id) newObject
{
       NSLog(@"New Object");
       NSMutableDictionary *newTrackEvent = [NSMutableDictionary dictionary];
       [newTrackEvent setObject:[NSNumber numberWithInt:0] 
forKey:@"timeValue"];
       return newTrackEvent;
}

I have no problem inserting items with the first controller. However, 
the application crashes when I bring up the second window and try to 
add the trackEvent items with the second controller. The crashes 
happens after adding more than one item (the add button is bound to 
"insert"). If I remove the subclass and use the standard 
NSArrayController class, the insert works fine. So, it must be 
something in my subclass.

Below is the crash.

Any thoughts? I'm a bit stumped.

thanks for any help,

Jaime


#0    0x9264b6e8 in objc_msgSend
#1    0x94692ced in __NSHashTableRetain
#2    0x91b96ed6 in CFSetAddValue
#3    0x946b8a5a in -[NSClassicHashTable insertKnownAbsentItem:]
#4    0x946b89a2 in NSHashInsertKnownAbsent
#5    0x958b048a in -[_NSModelObservingTracker _startObservingModelObject:]
#6    0x95b65247 in -[_NSModelObservingTracker 
startObservingModelObjectAtReferenceIndex:]
#7    0x95b6577a in -[_NSModelObservingTracker 
setObservingToModelObjectsRange:]
#8    0x95b655de in -[NSTableBinder tableView:updateVisibleRowInformation:]
#9    0x95b65592 in -[_NSBindingAdaptor 
tableView:updateVisibleRowInformation:]
#10    0x95900276 in -[NSTableView drawRect:]
#11    0x95990eb0 in -[NSView _drawRect:clip:]
#12    0x9598fa44 in -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#13    0x9598fd98 in -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#14    0x9598fd98 in -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#15    0x9598e3a3 in -[NSView 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:]
#16    0x9598f1f4 in -[NSView 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:]
#17    0x9598f1f4 in -[NSView 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:]
#18    0x9598dce3 in -[NSThemeFrame 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:]
#19    0x9598a814 in -[NSView 
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#20    0x958cb37d in -[NSView displayIfNeeded]
#21    0x958caf2d in -[NSWindow displayIfNeeded]
#22    0x958cad50 in _handleWindowNeedsDisplay
#23    0x91b8f9e2 in __CFRunLoopDoObservers
#24    0x91b90d45 in CFRunLoopRunSpecific
#25    0x91b91d38 in CFRunLoopRunInMode
#26    0x94fe48a4 in RunCurrentEventLoopInMode
#27    0x94fe46bd in ReceiveNextEventCommon
#28    0x94fe4531 in BlockUntilNextEventMatchingListInMode
#29    0x958c8d5b in _DPSNextEvent
#30    0x958c86a0 in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:]
#31    0x958c16d1 in -[NSApplication run]
#32    0x9588e9ba in NSApplicationMain
#33    0x00002c12 in start


Jaime Magiera

Sensory Research
http://www.sensoryresearch.net

Related mailsAuthorDate
mlNSArrayController subclass crash Jaime Magiera Feb 4, 02:28
mlRe: NSArrayController subclass crash mmalc crawford Feb 4, 02:42
mlRe: NSArrayController subclass crash Jaime Magiera Feb 4, 02:57