Re: NSIndexSet isEqual: sent to deallocated instance
Re: NSIndexSet isEqual: sent to deallocated instance
- Subject: Re: NSIndexSet isEqual: sent to deallocated instance
- From: Ron Lue-Sang <email@hidden>
- Date: Wed, 8 Oct 2008 10:52:32 -0700
On Oct 8, 2008, at 9:48 AM, Steve Cronin wrote:
Folks;
I have two custom tableViews and two custom arrayControllers.
The reasons for the custom objects are so the UI can respond to
specific key events and for drag and drop support.
Both tableView have their appropriate arrayControllers designated as
delegates and datasources.
The tableViews use bindings to define the column values.
The selection in one tableView controls the content of the other -
this is implemented by using 'filteredArray' against a 'backing'
array.
Overall, this is largely working pretty well.
Under some circumstances the the backing array is refreshed with new
content.
When this happens, sometimes, not always, an error is thrown:
*** -[NSIndexSet isEqual:]: message sent to deallocated instance
0x184de440
#0 0x92028907 in ___forwarding___
#1 0x92028a12 in __forwarding_prep_0___
#2 0x967fadb9 in _NSValuesAreEqual
#3 0x9683e9e6 in -[NSTableBinder _updateSelectionIndexes:]
#4 0x9683e073 in -[NSTableBinder
_observeValueForKeyPath:ofObject:context:]
#5 0x9683dd6d in -[NSTableBinder
observeValueForKeyPath:ofObject:change:context:]
#6 0x93d77ece in NSKVONotify
#7 0x93d08465 in -[NSObject(NSKeyValueObservingPrivate)
_notifyObserversForKeyPath:change:]
#8 0x9661cd7a in -[NSController _notifyObserversForKeyPath:change:]
#9 0x9661cc7b in -[NSController didChangeValueForKey:]
#10 0x96838ce4 in -[NSArrayController
didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#11 0x9683bb44 in -[NSArrayController
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis
:]
#12 0x96836a7a in -[NSArrayController setContent:]
#13 0x9683d2a2 in -[NSArrayDetailBinder
_refreshDetailContentInBackground:]
#14 0x93d77ece in NSKVONotify
#15 0x93cf4392 in -[NSObject(NSKeyValueObserverNotification)
didChangeValueForKey:]
#16 0x000cb3a9 in -[MyWindowController refreshViews] at
MyWindowController.m:347
I do not have either tableViews 'selectionIndexes' bound.
Actually, you probably do have selectionIndexes bound. When you have a
tableView with columns that are bound, the tableview automatically
establishes three bindings to the thing that the columns are bound to.
The three bindings that are auto-established are content,
sortDescriptors, and selectionIndexes.
If you take a look at the tableVie in IB, you'll see these bindings in
a section of their own. If you leave them alone – unbound in IB –
that's when you get the automatic-at-runtime-binding-creation (tho, if
you bind any of these by hand, we don't do any of the auto-creation at
runtime for the others – we assume you only want the partial set of
bindings for a reason).
You could try running with the leaks instrument and, when the app
crashes, take a look at the object history to see if you're
accidentally over-releasing an indexSet. If you can't find any of your
code at fault, file a radar with the Instruments document.
--------------------------
RONZILLA
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden