• 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: Quincey Morris <email@hidden>
  • Date: Thu, 31 Jan 2013 22:18:49 -0800

On Jan 31, 2013, at 21:51 , Kyle Sluder <email@hidden> wrote:

> All CFTypes are toll-free bridges to NSObject. (I was surprised when I learned this, and I don't know how far back this holds true.)

> GCD objects and XPC objects are NSObjects as of 10.8.

Ah, yes, I see now this is so, now that I look.

I presume the reason these don't work with KVC is that KVC checks the type information of a property and will see something like this:

> /* CoreGraphics - CGPath.h
>    Copyright (c) 2001-2011 Apple Inc.
>    All rights reserved. */
>
> typedef struct CGPath *CGMutablePathRef;
> typedef const struct CGPath *CGPathRef;

So KVC isn't going to know these are objects. Interestingly, types like 'dispatch_semaphore_t' aren't declared this way, so they probably *do* work via 'valueForKey:' without assistance.

_______________________________________________

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

  • Follow-Ups:
    • Re: KVC and Core Foundation types
      • From: Graham Cox <email@hidden>
References: 
 >KVC and Core Foundation types (From: Graham Cox <email@hidden>)
 >Re: KVC and Core Foundation types (From: Seth Willits <email@hidden>)
 >Re: KVC and Core Foundation types (From: Kyle Sluder <email@hidden>)
 >Re: KVC and Core Foundation types (From: Quincey Morris <email@hidden>)
 >Re: KVC and Core Foundation types (From: Kyle Sluder <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
  • Next by thread: Re: KVC and Core Foundation types
  • Index(es):
    • Date
    • Thread