Re: @property problem
Re: @property problem
- Subject: Re: @property problem
- From: "Melissa J. Turner" <email@hidden>
- Date: Mon, 11 Feb 2008 13:27:00 -0800
Properties don't allocate storage, they simply provide a mechanism for
accessing it.
You need to declare your ivar somewhere:
@interface MyWindow : NSWindow
{
id capturing;
}
+Melissa
On Feb 11, 2008, at 13:14, Randall Meadows wrote:
So, I'm trying to be a good little Obj-C 2.0 programmer and use
these newfangled properties. Xcode doesn't seem to appreciate my
attempts.
I've boiled the problem down to this snippet:
@interface MyWindow : NSWindow
{
}
@property(readwrite) BOOL capturing;
@end
@implementation MyWindow
@synthesize capturing;
@end
When I compile that, I get the error:
error: synthesized property 'capturing' must either be named the
same as a compatible ivar or must explicitly name an ivar
AFAICT, "capturing" IS the name of my ivar. What is it *really*
complaining about? What did I do wrong?
Thanks!
randy
_______________________________________________
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
_______________________________________________
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