• 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: About iVars declaration and property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About iVars declaration and property


  • Subject: Re: About iVars declaration and property
  • From: glenn andreas <email@hidden>
  • Date: Tue, 15 Nov 2011 10:15:34 -0600

On Nov 15, 2011, at 9:48 AM, Torsten Curdt wrote:

>>> If you’re 64-bit only (or if you require Lion or better), there’s no real reason to explicitly declare the ivars these days.
>>
>> As others have pointed out, this is not true. There are practical differences between declaring and not declaring the ivar explicitly. I almost never declare the ivar explicitly, but once in a while I need it to show up in the debugger or to be available in a subclass, and then I must declare it explicitly. m.
>
> TBH what I don't get is why this cannot be changed in LLVM instead -
> then we would not have the 64-bit/10.7 restrictions.
>
> Of course it would not change what's happening in the runtime but I
> guess most of people only care what they need to type anyway.


In four words: Fragile Base Class Problem.

The problem is that a subclass (in 32 bit OS X) needs to know the size of the superclass so it know how to lay out its ivars.  If there is no explicit ivars, there is no way for the compiler to know the size (since when it is compiling the subclass it doesn't see all the files that may potentially contain the parent's ivars).

Glenn Andreas                      email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL

_______________________________________________

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: About iVars declaration and property
      • From: Torsten Curdt <email@hidden>
References: 
 >Re: About iVars declaration and property (From: Matt Neuburg <email@hidden>)
 >Re: About iVars declaration and property (From: Torsten Curdt <email@hidden>)

  • Prev by Date: Re: About iVars declaration and property
  • Next by Date: Re: About iVars declaration and property
  • Previous by thread: Re: About iVars declaration and property
  • Next by thread: Re: About iVars declaration and property
  • Index(es):
    • Date
    • Thread