Re: KVC and Core Foundation types
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