Re: Detecting reading a key in KVC
Re: Detecting reading a key in KVC
On 10 Nov 2010, at 12:47, Remco Poelstra wrote:
> Hi,
>
> I've an object which properties I access via key-value coding. These properties are sometimes "uninitialized" (that means, the real value needs to be read from the Wifi network). I would like to detect a read of such property and then fetch it from the network. It's not a problem that in the mean time a "wrong" value is returned. How can I detect a read of a property?
>
> Kind regards,
>
> Remco Poelstra
>
>
Try overriding your objects -valueForKey: and -valueForKeyPath:
NSKeyValueCoding is implemented as a category on NSObject so will be available on your object.
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
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