Re: How does NSArrayController know?
Re: How does NSArrayController know?
- Subject: Re: How does NSArrayController know?
- From: Chris Hanson <email@hidden>
- Date: Fri, 5 Oct 2007 00:59:15 -0700
On Oct 5, 2007, at 12:03 AM, Bob Ueland wrote:
I've looked at "NSArrayController Class Reference" but couldn't find
any info. I suspected kvc compliance but the document never
mentions it (or I missed it).
You suspect correctly; in the example, MyDocument is Key-Value Coding
compliant for an ordered relationship under the "employees" key. To
get at this ordered relationship, the interested party can either
invoke the methods directly or (in generic, reusable code like
NSArrayController) manipulate the proxy retuned as the result of
sending an instance of MyDocument -mutableArrayValueForKey: with the
key "employees".
How this works is documented in the Programming Guide for Key-Value
Coding as well as in <Foundation/NSKeyValueCoding.h>. There are a
number of additional methods that can be implemented that will also be
invoked at appropriate times. It's also fundamental to working with
Core Data relationships, though they are unordered and thus use -
mutableSetValueForKey:.
-- Chris
_______________________________________________
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