Re: Detecting reading a key in KVC
Re: Detecting reading a key in KVC
- Subject: Re: Detecting reading a key in KVC
- From: Remco Poelstra <email@hidden>
- Date: Thu, 11 Nov 2010 13:41:58 +0100
Op 10-11-2010 15:31, Quincey Morris schreef:
On Nov 10, 2010, at 06:10, email@hidden wrote:
I was just thinking that the overrides would provide a convenient point to process all requests for undefined properties.
Depends on the design and requirements of the model I suppose.
I don't think that's happening here -- the property isn't undefined initially, it just has an incorrect value initially. :)
The point is, I think, to avoid overriding 'valueForKey:', because of the potential horrendous performance problems that could result.
Thanks for all replies. I think I've a problem there. I store all my
properties in a NSMutableDictionary, so implementing my own getters is
not possible. I tried overriding valueForKey: by subclassing
NSMutableDictionary, but soon found out that was not possible as it is a
cluster.
Leaves me wondering whether I should hardcode all properties (82 items)
on my own object or try to make a more intelligent subclass of
NSMutableDictionary. Or maybe a composite object?
Kind regards,
Remco Poelstra
_______________________________________________
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