Re: subclass overwriting superclass ivar
Re: subclass overwriting superclass ivar
- Subject: Re: subclass overwriting superclass ivar
- From: "Sean McBride" <email@hidden>
- Date: Wed, 26 May 2010 11:59:23 -0400
- Organization: Rogue Research Inc.
On Wed, 26 May 2010 13:54:17 +0100, Joanna Carter said:
>> A subclass ivar is apparently overwriting a super class ivar.
>> When an instance of MGS_B sets stderrData the super class ivar
>tempFilePath gets overwritten.
>
>I'm not sure what you mean here by "overwrite".
>
>@interface Base : NSObject
>{
> @private
> int i;
>}
>
>@end
>
>@interface Sub : Base
>{
> @private
> int i;
>}
>
>@end
>
>This code demonstrates what I would understand by overwriting, and it
>fails to compile. Although, it should be possible to redeclare such
>private ivars, it certainly is in C# and Delphi.
Joanna,
I think you are confusing some similar-sounding words: override and
overwrite (and there's also overload). By overwrite, he means the
memory occupied by one ivar is being unexpectedly written to when
writing to a different ivar.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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