• 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: Joshua Emmons <email@hidden>
  • Date: Mon, 11 Feb 2008 15:29:03 -0600

I've boiled the problem down to this snippet:

@interface MyWindow : NSWindow
{
}
@property(readwrite) BOOL	capturing;
...
error: synthesized property 'capturing' must either be named the same as a compatible ivar or must explicitly name an ivar

You haven't declared a compatible ivar named "capturing". You'd need to do something like this:


@interface MyWindow : NSWindow
{
	BOOL capturing;   // <-- here!
}
@property(readwrite) BOOL	capturing;

The line marked above declared an ivar with the same name and the same type as your property declaration, so now synthesize will be able to do its thing.

Obj-C *can* be smart enough to generate this ivar for you behind the scenes, but only if you're using the 64bit runtime. If you don't require 32bit compatibility, turn it off, and then you don't have to worry about declaring these ivars for synthesize.


Cheers, -Joshua Emmons _______________________________________________

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: @property problem
      • From: William Squires <email@hidden>
    • Re: @property problem
      • From: Adam P Jenkins <email@hidden>
References: 
 >@property problem (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: @property problem
  • Next by Date: Re: @property problem
  • Previous by thread: Re: @property problem
  • Next by thread: Re: @property problem
  • Index(es):
    • Date
    • Thread