On 1 Feb, 2013, at 1:53 PM, Graham Cox <graham....@bigpond.com> wrote:

> 
> On 01/02/2013, at 4:08 PM, Kyle Sluder <k...@ksluder.com> wrote:
> 
>> But CFTypes *are* NSObjects. So I'm not sure why your case isn't working. 
>> Can you be more specific?
> 
> 
> This is why the result surprised me - I have "known" this for years, and 
> assumed that there wouldn't be a problem with this. But, this is the first 
> time I've ever actually tried it, and what I found is that if I have a 
> property, e,g
> 
> @property (nonatomic, assign) CGColorRef              myColor;
> 
> and I ask for this using
> 
> [someObject valueForKey:@"myColor"];
> 
> then instead of returning the object, it hits -valueForUndefinedKey: instead.


I don't understand that. The search pattern for valueForKey: is documented very 
clearly and if you have a myColor method or a _myColor instance variable, as 
you surely must, it should find it and return it. The only question from 
reading the documentation is .. what should it return it as? Were that the 
issue, it having a problem converting a CGColorRef to something it can return, 
I'd not expect valueForUndefinedKey: but some other exception. 
_______________________________________________

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