On Jan 31, 2013, at 11:46 PM, Quincey Morris 
<quinceymor...@rivergatesoftware.com> wrote:

> On Jan 31, 2013, at 21:08 , Kyle Sluder <k...@ksluder.com> wrote:
> 
>> But CFTypes *are* NSObjects.
> 
> Only if they're toll-free bridged

Huh? It's been my understanding that all CFTypes bridge to NSObjects. CGPathRef 
certainly does:

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        CGPathRef path = CGPathCreateWithRect(CGRectMake(0, 1, 2, 3), NULL);
        
        for (Class class = [(__bridge id)path class]; class != nil; class = 
[class superclass]) {
            NSLog(@"%@", NSStringFromClass(class));
        }
        
        CGPathRelease(path);
    }
    return 0;
}

2013-01-31 23:55:51.570 typetest[2906:303] __NSCFType
2013-01-31 23:55:51.576 typetest[2906:303] NSObject

Given this, I'd expect you could make it work with KVC by making the property 
an id instead of a CGPathRef, and doing a bridge cast every time you want to 
use it. Of course, overriding valueForKey: is probably cleaner though.

Charles


_______________________________________________

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