Re: NSArrayController design/usage question
Re: NSArrayController design/usage question
- Subject: Re: NSArrayController design/usage question
- From: mmalc Crawford <email@hidden>
- Date: Tue, 08 Sep 2009 00:04:41 -0700
On Sep 6, 2009, at 10:00 AM, Steven Degutis wrote:
For instance, if you have 2 genuine properties on your "Person"
entity called firstName and lastName then you can create a fullName
property
on your Person class, and when firstName or lastName change, call
-willChangeValueForKey: and -didChangeValueForKey: on "fullName" and
then
have your -fullName method return a concatenation of the first and
last
names.
This is at best misleading.
In this situation, you should typically not invoke the change
notification methods yourself; instead, you should set up dependent
keys as described in <http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/DependentKeys.html#//apple_ref/doc/uid/20002179-BAJEAIEE
>
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