Re: KVC and Core Foundation types
Re: KVC and Core Foundation types
- Subject: Re: KVC and Core Foundation types
- From: Kyle Sluder <email@hidden>
- Date: Thu, 31 Jan 2013 21:08:28 -0800
On Jan 31, 2013, at 8:33 PM, Seth Willits <email@hidden> wrote:
> On Jan 31, 2013, at 7:36 PM, Graham Cox wrote:
>
>> It makes me wonder how other objects in the system, e.g. CALayer, which have many similar CF type properties, are able to support NSCoding and KVC.
>
> While I can't say whether or not CALayer does it, you could override valueForKey: and handle those properties yourself.
CALayer almost certainly does, because it functions as an extensible KVC container (basically, it's like a dictionary in that you can call -setValue:forKey: with any key your heart desires).
Graham, the docs for -valueForKey: imply that it will work with any type, object or not: http://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/DataTypes.html
But CFTypes *are* NSObjects. So I'm not sure why your case isn't working. Can you be more specific?
--Kyle Sluder
_______________________________________________
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