How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
- Subject: How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
- From: email@hidden
- Date: Sat, 25 Feb 2006 08:33:14 -0800
Simple question.
If I have a binding like contentArray in an NSArrayController which
is bound to an object that returns an array, if the key is not
arrangedObjects (in the controller key binding),
the controller treats the returned array like its just one object.
NSTableColumn does the same thing.
This is strange, shouldn't NSArrayController's contentArray
explicitly know its getting an array, so each item is procured and
managed by it?
Not as a single object. In my case, the array controller keeps
reporting its count as 1 (that item being the array that should be
its content).
I'm becomeing increasingly frustrated by this.
According to this: http://www.cocoadev.com/index.pl?NSArrayController
Notably:
"Problem is that there are private objects communicating (like
NSBinder?, NSTableBinder?) which seem to get the row values for the
table column. The controller itself gets asked only for the
"arrangedObjects" key path. You cannot override NSArrayController
valueForKeyPath method and return your value for e.g.
"arrangedObjects.indexInContentArray"."
This is exactly what I've been encountering.
Does *anyone* know how to get an array into a table column or
NSArrayController using a plain array or array indexed accessors?
I've tried even calling my array "arrangedObjects" hoping to trick
the thing, but it doesn't work.........
Chiao,
Andre
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden