• 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
Binding to an array.name, how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding to an array.name, how?


  • Subject: Binding to an array.name, how?
  • From: Glen Low <email@hidden>
  • Date: Mon, 16 May 2005 13:18:30 +0800

Dear Gurus of Cocoa Bindings,

I've created my own subclass of NSController and called exposeBinding for the various bindings available on it. Each binding corresponds exactly with a KVC-compliant pair of methods e.g. array and setArray.

Now I can easily bind arrays of simple values to the binding. However, supposing I have an array of dictionaries, each dictionary with a key of "name", I find I cannot bind to array.name... it fails at runtime with a

[<NSCFArray 0x3b85e0> addObserver:forKeyPath:options:context:] is not supported. Key path: name

On the other hand, this is precisely the technique used for NSPopUpButton's binding contentValues: provided I bind content first to the array, I can bind contentValues to array.name with no problems. If I don't bind the content first, then it fails with the above error.

So the question is: How does NSPopUpButton allow or implement binding its contentValues to an array.name, where name is a field of the dictionary which is an element of array? (Hope that's clear...)





Cheers, Glen Low



---

pixelglow software | simply brilliant stuff

www.pixelglow.com

aim: pixglen


 _______________________________________________
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: Binding to an array.name, how?
      • From: Scott Stevenson <email@hidden>
    • Re: Binding to an array.name, how?
      • From: Bob Ippolito <email@hidden>
  • Prev by Date: Manually Editing Preferences
  • Next by Date: Re: FSCopyObjectAsync: useless and crippled
  • Previous by thread: Re: Manually Editing Preferences
  • Next by thread: Re: Binding to an array.name, how?
  • Index(es):
    • Date
    • Thread