On Nov 12, 2010, at 12:05, Remco Poelstra wrote:

> If I understand it correctly, for all properties, each and everytime, 
> valueForUndefinedKey is called?

Correct.

> So I do also need to override setValue:forUndefinedKey in case 2? To make 
> sure that the properties end up in the dictionary?

Correct. I omitted the setter behavior for brevity in the discussion.

> Basically it's the same to what I've now (based on the discussion with 
> Graham), but adding "Undefined" to my method names, I do keep the performance 
> enhancements of the original implementation?

It has *better* performance than the original implementation. Originally, 
*every* call to 'valueForKey:' involved custom code and an extra dictionary 
lookup. With this implementation, that only happens for your keys -- and 
genuinely undefined keys, of course.


_______________________________________________

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