Re: NSValueTransformer - Object Reference
Re: NSValueTransformer - Object Reference
- Subject: Re: NSValueTransformer - Object Reference
- From: Chris Hanson <email@hidden>
- Date: Sat, 17 Jul 2004 15:57:18 -0700
On Jul 17, 2004, at 2:00 PM, Jonathan Younger wrote:
Why not bind the text fields to arrangedObjects.whateverProperty
directly as you describe? That should "just work" (unless I'm
misunderstanding the intent).
When I do this I get ("first record", "second record") displayed for
the NSTextField value.
'("foo", "bar")' is property list notation for an array of two strings.
What's happening is that when you ask for the value of the key path
"arrangedObjects.whateverProperty" it's the same as asking for the
value of the key "arrangedObjects", and then asking *that* for the
value of the key "whateverProprety". This will result in an array
containing the result of asking each element in arrangedObjects for the
value of the key "whateverProperty".
See the documentation for -[NSArray valueForKey:] for more details
about how arrays behave when used with key-value coding.
-- Chris
--
Chris Hanson <email@hidden>
http://www.livejournal.com/users/chanson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.