Skip navigation.
 
mlRe: cocoa bindings NSTableColumn to @allKeys?
FROM : Michael Hanna
DATE : Mon Dec 31 08:08:37 2007

Each YKKFlickrPhotoList object has an NSMutableDictionary of photos(I
have -photos and -setPhotos accessors). Flickr Photo List
NSArrayController is binding to the @allKeys of the m_photoLists
dictionary in YKKFlickrUser.

I want to make another tableview with a column that displays the photo
attributes of the selected photolist. Do I bind to the Flickr Photo
List NSArrayController? This is only displaying the photolist key
names ... how do I get at the values that that key represents? Do I
have to use an NSDictionaryController to do this?

Michael

On Dec 30, 2007 10:53 AM, mmalc crawford <<email_removed>> wrote:
>
> 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
>
>

Related mailsAuthorDate
mlcocoa bindings NSTableColumn to @allKeys? Michael Hanna Dec 30, 08:00
mlRe: cocoa bindings NSTableColumn to @allKeys? Keary Suska Dec 30, 18:16
mlRe: cocoa bindings NSTableColumn to @allKeys? mmalc crawford Dec 30, 19:53
mlRe: cocoa bindings NSTableColumn to @allKeys? mmalc crawford Dec 30, 20:13
mlRe: cocoa bindings NSTableColumn to @allKeys? Michael Hanna Dec 31, 03:12
mlRe: cocoa bindings NSTableColumn to @allKeys? Michael Hanna Dec 31, 07:19
mlRe: cocoa bindings NSTableColumn to @allKeys? Michael Hanna Dec 31, 08:08
mlRe: cocoa bindings NSTableColumn to @allKeys? mmalc crawford Dec 31, 08:10
mlRe: cocoa bindings NSTableColumn to @allKeys? mmalc crawford Dec 31, 10:41
mlRe: cocoa bindings NSTableColumn to @allKeys? Michael Hanna Jan 1, 19:19
mlRe: cocoa bindings NSTableColumn to @allKeys? mmalc crawford Jan 1, 20:33