Re: cocoa bindings NSTableColumn to @allKeys?
Re: cocoa bindings NSTableColumn to @allKeys?
- Subject: Re: cocoa bindings NSTableColumn to @allKeys?
- From: mmalc crawford <email@hidden>
- Date: Sun, 30 Dec 2007 10:53:37 -0800
On Dec 30, 2007, at 9:16 AM, Keary Suska wrote:
You want to bind the value to an array controller that is bound
using the
above options.
This is probably insufficient, since you then need to know what key to
use in the table column binding (and @allKeys won't work as a keypath).
On Dec 29, 2007, at 11:00 PM, Michael Hanna wrote:
I have a model object YKKFlickrUser which aggregates an
NSMutableDictionary called m_photoLists which contains keys for
another model object, YKKPhotoList(I have accessors -photoLists and
-setPhotoLists).
[...]
bind > Flickr Users,
controller key > "selection",
model key path > "photoLists.@allKeys"
Is each key simply a string (as would seem to be the case from the
spec)? And do you intend the keys to be editable?
If both are true, then using an array controller to manage them won't
work, since the bindings architecture expects to deal with objects
that themselves have keys and values and an array controller. If you
can get the actual dictionary (from which allKeys is derived) then on
Leopard you can use the NSDictionaryController (bind its content
dictionary to [Flickr Users].selection.photoLists.theDictionary).
If each key is simply a string and you just want to display them, then
you can use an additional array controller, but you need to "fudge" a
key for the table column binding.
You bind the array controller's contentArray to [Flickr
Users].selection.photoLists.allKeys
You can then bind the table column to:
[AllKeysArrayController].arrangedObjects.self
or
[AllKeysArrayController].arrangedObjects.description
mmalc
_______________________________________________
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