Skip navigation.
 
mlRe: Cocoa says not KVC compliant
FROM : Alex Wait
DATE : Wed Jul 02 21:26:13 2008

if you have the @property statement, and you use the I think @synthesize
(could be wrong about that) you don't need to write the functions yourself.
Try taking out the @property statement.

On Wed, Jul 2, 2008 at 10:13 AM, Milen Dzhumerov <<email_removed>> wrote:

> 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_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>




--
If you can't be kind, at least have the decency to be vague.

Related mailsAuthorDate
mlCocoa says not KVC compliant Milen Dzhumerov Jul 2, 19:13
mlRe: Cocoa says not KVC compliant Alex Wait Jul 2, 21:26
mlRe: Cocoa says not KVC compliant Nathan Vander Wilt Jul 2, 22:33
mlRe: Cocoa says not KVC compliant Chris Suter Jul 2, 22:34
mlRe: Cocoa says not KVC compliant mmalc crawford Jul 2, 23:04