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 14:01:45 +0100
Op 11-11-2010 13:48, Graham Cox schreef:
On 11/11/2010, at 11:41 PM, Remco Poelstra wrote:
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?
If the requirement is simply to distinguish between an uninitialised value and a real value, why not just implement your own object with a method -valueForKey: and do whatever you want in there. It could have a NSMutableDictionary as a backing store. One method (not 82) and problem solved.
Sounds so simple I'm surely missing something....
Seems so :) I just tried that and observing the change of properties is
now non-functional, as the request for observing is not forwarded to the
NSDictionary behind my own object. Seems I've to override a whole lot of
methods to forward them all to the backingstore.
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