• 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: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 17 Feb 2008 01:03:47 +0100

Because changing the 32 bits runtime to support this kind of feature would have break binary compatibility with previous version, and previous applications.
This is the same for "zero-cost" exceptions that works with 64 bits applications, but not with 32 bits applications.
And it is also the case for the fragile ivar problem that was solve in the 64 bits runtime.


Le 16 févr. 08 à 23:35, William Squires a écrit :

Okay, but why the diff? Why should it matter whether you're using 32 or 64 bits? Storage is still storage, and it seems you'd still need to provide that storage even under a 64-bit runtime.

On Feb 11, 2008, at 3:29 PM, Joshua Emmons wrote:

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

_______________________________________________

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


  • Follow-Ups:
    • Re: @property problem
      • From: William Squires <email@hidden>
References: 
 >@property problem (From: Randall Meadows <email@hidden>)
 >Re: @property problem (From: Joshua Emmons <email@hidden>)
 >Re: @property problem (From: William Squires <email@hidden>)

  • Prev by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Next by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Previous by thread: Re: @property problem
  • Next by thread: Re: @property problem
  • Index(es):
    • Date
    • Thread