• 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: Kyle Sluder <email@hidden>
  • Date: Wed, 26 May 2010 06:48:46 -0700

On May 26, 2010, at 6:00 AM, Roland King <email@hidden> wrote:

@interface A(MyCategory)

-(void)someMethodWhichLegallyAccessesThePrivateVariablePriv;

@end

That's legal, I can write a category against an already-compiled class without having the source and without recompiling it and I can access any of the private variables of that class. So no the compiler cannot throw away instance variables when it compiles the class originally even if no method of A used them originally because someone might go write a category against the compiled object which needs it later.

Actually, this will not work across a module boundary on the modern runtime because the linker will strip the symbol for the private ivar.


--Kyle Sluder
_______________________________________________

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: 
 >subclass overwriting superclass ivar (From: "email@hidden" <email@hidden>)
 >Re: subclass overwriting superclass ivar (From: vincent habchi <email@hidden>)
 >Re: subclass overwriting superclass ivar (From: Graham Cox <email@hidden>)
 >Re: subclass overwriting superclass ivar (From: vincent habchi <email@hidden>)
 >Re: subclass overwriting superclass ivar (From: Roland King <email@hidden>)

  • Prev by Date: Question about predicates and list properties.
  • Next by Date: Re: Question about predicates and list properties.
  • Previous by thread: Re: subclass overwriting superclass ivar
  • Next by thread: Re: subclass overwriting superclass ivar
  • Index(es):
    • Date
    • Thread