• 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
Cocoa says not KVC compliant
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa says not KVC compliant


  • Subject: Cocoa says not KVC compliant
  • From: Milen Dzhumerov <email@hidden>
  • Date: Wed, 2 Jul 2008 18:13:53 +0100

Hi all,

I've run into a something I find strange. I've got a property declared as:

@property(readwrite, assign, nonatomic) CGImageRef image;

And it's implemented as:

-(CGImageRef)image
{
	return mImage;
}

-(void)setImage:(CGImageRef)newImage
{
	if(mImage != newImage)
	{
		CGImageRelease(mImage);
		CGImageRetain(newImage);
		mImage = newImage;
	}
}

When I try to set it using KVC (e.g. [obj setValue:[NSValue valueWithPointer:image] forKeyPath:@"image"]), it says [<*ClassName* 0x133050> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key image.'

Any hints on why the class is not KVC-compliant? I've read the docs and it seems to satisfy the bullet points listed (moreover it's even declared as @property so the naming of the setters / getters should be alright).

Thanks,
M
_______________________________________________

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: Cocoa says not KVC compliant
      • From: Chris Suter <email@hidden>
    • Re: Cocoa says not KVC compliant
      • From: Nathan Vander Wilt <email@hidden>
    • Re: Cocoa says not KVC compliant
      • From: "Alex Wait" <email@hidden>
  • Prev by Date: Re: A question of style: Returning 'pairs'
  • Next by Date: Re: A question of style: Returning 'pairs'
  • Previous by thread: Re: A question of style: Returning 'pairs'
  • Next by thread: Re: Cocoa says not KVC compliant
  • Index(es):
    • Date
    • Thread