Re: KVC and Core Foundation types
Re: KVC and Core Foundation types
- Subject: Re: KVC and Core Foundation types
- From: Graham Cox <email@hidden>
- Date: Fri, 01 Feb 2013 16:09:22 +1100
On 01/02/2013, at 3:33 PM, Seth Willits <email@hidden> wrote:
> While I can't say whether or not CALayer does it, you could override valueForKey: and handle those properties yourself.
>
Yep, that's sort of what I'm doing... but it's more complex than that.
Basically, CFTypes are not natively archivable. Neither are they "found" by valueForKey:, so -valueForUndefinedKey: is called. I then have to re-find the property myself by implementing the same search algorithm that KVC uses, detect the CFType of the object and call a function (different for each kind) that will wrap or convert the CFType with something that is archivable, or usable by an observer using KVO to observe changes to these properties.
I also have to override -valueForUndefinedKey: and do this in every object that has properties that are CFTypes.
My question really is if this is necessary or is there a more cunning, generic way to handle this?
--Graham
_______________________________________________
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