On May 26, 2010, at 6:00 AM, Roland King <r...@rols.org> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to