Re: subclass overwriting superclass ivar
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