• 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: subclass overwriting superclass ivar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subclass overwriting superclass ivar


  • Subject: Re: subclass overwriting superclass ivar
  • From: Graham Cox <email@hidden>
  • Date: Wed, 26 May 2010 22:22:23 +1000

On 26/05/2010, at 10:13 PM, vincent habchi wrote:

> If I am not mistaken, if your superclass ivar is private (!= protected), it cannot be accessed from its subclasses. Thus, the compiler can choose to reuse part of the heap dedicated to private variables to implement subclasses own private ivars.


I'm pretty sure you are mistaken. If this were even remotely true, object programming would be impossible.

@private only declares the visibility of an ivar to its subclasses, it does not give the compiler carte blanche to write over anything it fancies.

--Graham


_______________________________________________

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: subclass overwriting superclass ivar
      • From: vincent habchi <email@hidden>
References: 
 >subclass overwriting superclass ivar (From: "email@hidden" <email@hidden>)
 >Re: subclass overwriting superclass ivar (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: subclass overwriting superclass ivar
  • Next by Date: Re: rendering PDF on iPad's
  • Previous by thread: Re: subclass overwriting superclass ivar
  • Next by thread: Re: subclass overwriting superclass ivar
  • Index(es):
    • Date
    • Thread