On Nov 11, 2010, at 7:11 AM, Graham Cox wrote:

> Just write a wrapper for -setObject:forKey: and -valueForKey:  The first just 
> calls the same method on its (mutable) dictionary, the second can first check 
> for whether the value is actually present and if not kick off some task to 
> fetch it, or else just get it from the dictionary and return it.

You should not override -setValue:forKey: or -valueForKey: if you can avoid it. 
 Instead, implement the methods -setValue:forUndefinedKey: and 
-valueForUndefinedKey:.  They are precisely for implementing "dynamic" 
properties in this manner.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to