On 01/02/2013, at 3:33 PM, Seth Willits <sli...@araelium.com> 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 (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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to