• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: KVC and Core Foundation types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >KVC and Core Foundation types (From: Graham Cox <email@hidden>)
 >Re: KVC and Core Foundation types (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: KVC and Core Foundation types
  • Next by Date: Re: KVC and Core Foundation types
  • Previous by thread: Re: KVC and Core Foundation types
  • Index(es):
    • Date
    • Thread