NSTableView, NSArrayController predicate, change data exception
NSTableView, NSArrayController predicate, change data exception
- Subject: NSTableView, NSArrayController predicate, change data exception
- From: Trygve Inda <email@hidden>
- Date: Mon, 13 Jan 2014 09:04:10 -0800
- Thread-topic: NSTableView, NSArrayController predicate, change data exception
I have an NSTableView backed by an NSArrayController.
I call setFilterPredicate on the NSArrayController to set a predicate of
"rating == 2" This does filter the table to show only those entries where
rating is 2.
The rating column is a Level Indicator and set to show star ratings in IB.
It is tied to the NSArrayController with a binding. If I edit the rating
field to change it while the table has a filter predicate, the line item
disappears (because it no longer matches the predicate), but I get this:
*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array
0 CoreFoundation 0x00007fff8684fb06
__exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8edda3f0
objc_exception_throw + 43
2 CoreFoundation 0x00007fff867ec8ec -[__NSArrayM
objectAtIndex:] + 252
3 AppKit 0x00007fff8ddecf0e -[NSBinder
_setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicabl
eKeys:error:] + 568
4 AppKit 0x00007fff8e0eb47a -[NSBinder
setValue:forBinding:atIndex:error:] + 557
5 AppKit 0x00007fff8e476b83
-[_NSValueBinderPlugin
applyObjectValue:forBinding:operation:needToRunAlert:error:] + 248
6 AppKit 0x00007fff8e4353e8
-[NSValueBinder
_applyObjectValue:forBinding:canRecoverFromErrors:handleErrors:typeOfAlert:d
iscardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:] + 107
7 AppKit 0x00007fff8e4358dc
-[NSValueBinder
applyDisplayedValueHandleErrors:typeOfAlert:canRecoverFromErrors:discardEdit
ingCallback:otherCallback:callbackContextInfo:didRunAlert:error:] + 612
8 AppKit 0x00007fff8e436633
-[NSValueBinder performAction:] + 305
9 AppKit 0x00007fff8e47272f
-[_NSBindingAdaptor _objectDidTriggerAction:bindingAdaptor:] + 133
10 AppKit 0x00007fff8e47289e
-[_NSBindingAdaptor objectDidTriggerAction:] + 196
11 AppKit 0x00007fff8df7179a -[NSControl
sendAction:to:] + 56
12 AppKit 0x00007fff8df716eb -[NSCell
_sendActionFrom:] + 138
13 AppKit 0x00007fff8df6f943 -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] + 1199
14 AppKit 0x00007fff8e269514
-[NSLevelIndicatorCell trackMouse:inRect:ofView:untilMouseUp:] + 118
15 AppKit 0x00007fff8e376ec0 -[NSTableView
_tryCellBasedMouseDown:atRow:column:withView:] + 1650
16 AppKit 0x00007fff8e37833b -[NSTableView
mouseDown:] + 4540
17 AppKit 0x00007fff8df6650e -[NSWindow
sendEvent:] + 6853
18 AppKit 0x00007fff8df62644
-[NSApplication sendEvent:] + 5761
19 AppKit 0x00007fff8de7821a
-[NSApplication run] + 636
If there is no predicate set to filter the NSArrayController, then no error
occurs.
_______________________________________________
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