• 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: Bind to element in dictionary in array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind to element in dictionary in array


  • Subject: Re: Bind to element in dictionary in array
  • From: George Orthwein <email@hidden>
  • Date: Wed, 28 Jun 2006 13:04:25 -0400

This is a very common question... which I found out after I recently got tripped up on it!

You can't bind to an array like that. The confusing part for me is that [dict valueForKeyPath:@"MyArray.element1.someBoolValueD"] will return a perfectly fine array, but that same keypath can't be used for binding or kvo observing. (Well, maybe that does make some sense.)

Anyway, you need to add a new ArrayController. Set its contentArray to "Dict.MyArray" and then you can bind to that. The ArrayController adds the KVO magic to the array.

Hope that helps (and, um, I hope I'm correct. Since I recently got tripped on it, I don't guarantee anything!)

George

_______________________________________________
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


  • Follow-Ups:
    • Re: Bind to element in dictionary in array
      • From: Trygve Inda <email@hidden>
References: 
 >Bind to element in dictionary in array (From: Trygve Inda <email@hidden>)

  • Prev by Date: Bind to element in dictionary in array
  • Next by Date: Sorting ABPerson array with NSSortDescriptors
  • Previous by thread: Bind to element in dictionary in array
  • Next by thread: Re: Bind to element in dictionary in array
  • Index(es):
    • Date
    • Thread