• 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: Roland King <email@hidden>
  • Date: Fri, 01 Feb 2013 14:19:48 +0800

On 1 Feb, 2013, at 1:53 PM, Graham Cox <email@hidden> wrote:

>
> On 01/02/2013, at 4:08 PM, Kyle Sluder <email@hidden> 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 (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: Roland King <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: Graham Cox <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