• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cocoa bindings NSTableColumn to @allKeys?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa bindings NSTableColumn to @allKeys?


  • Subject: Re: cocoa bindings NSTableColumn to @allKeys?
  • From: "Michael Hanna" <email@hidden>
  • Date: Sun, 30 Dec 2007 23:08:37 -0800

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@hidden> 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
>
>
_______________________________________________

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

  • Follow-Ups:
    • Re: cocoa bindings NSTableColumn to @allKeys?
      • From: mmalc crawford <email@hidden>
References: 
 >Re: cocoa bindings NSTableColumn to @allKeys? (From: Keary Suska <email@hidden>)
 >Re: cocoa bindings NSTableColumn to @allKeys? (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Storing licence info (other than NSUserDefaults)
  • Next by Date: Re: cocoa bindings NSTableColumn to @allKeys?
  • Previous by thread: Re: cocoa bindings NSTableColumn to @allKeys?
  • Next by thread: Re: cocoa bindings NSTableColumn to @allKeys?
  • Index(es):
    • Date
    • Thread