Re: subclass overwriting superclass ivar
Re: subclass overwriting superclass ivar
- Subject: Re: subclass overwriting superclass ivar
- From: vincent habchi <email@hidden>
- Date: Wed, 26 May 2010 14:41:52 +0200
Le 26 mai 2010 à 14:22, Graham Cox a écrit :
> 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.
Hmmm... Let's say you have a class A with a private variable "priv" and b a pointer to a subclass of A. Is:
[(A *)b priv]
legal?
Now, admitting B never accesses any of A variables, can the compiler optimize space by throwing away all A private variables?
Vincent
PS: thanks for this "carte blanche" :)_______________________________________________
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