• 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: @property problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @property problem


  • Subject: Re: @property problem
  • From: Randall Meadows <email@hidden>
  • Date: Mon, 11 Feb 2008 14:56:14 -0700

A big THANKS to all of you who responded so quickly to point out my absent-mindedness of not actually *declaring* my "capturing" ivar. I can't tell you how many times I overlooked that simple fact when I was comparing my code to the sample code in the ObjC 2.0 docs.

Please consider me sufficiently flogged for being a bonehead. (No actual noodles were harmed.)

On Feb 11, 2008, at 2:14 PM, 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?

_______________________________________________

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


References: 
 >@property problem (From: Randall Meadows <email@hidden>)

  • Prev by Date: Bugs in NSColor and NSImage in Leopard?
  • Next by Date: re: split up alloc and init?
  • Previous by thread: Re: @property problem
  • Next by thread: Bugs in NSColor and NSImage in Leopard?
  • Index(es):
    • Date
    • Thread