Re: subclass overwriting superclass ivar
Re: subclass overwriting superclass ivar
- Subject: Re: subclass overwriting superclass ivar
- From: "email@hidden" <email@hidden>
- Date: Wed, 26 May 2010 16:31:24 +0100
On 26 May 2010, at 13:55, Uli Kusterer wrote:
> On May 26, 2010, at 1:40 PM, email@hidden wrote:
>> 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.
>
> Are you using this class across module boundaries? E.g. is the base class in a framework and the subclass in an application that links to the framework? In that case, you may be running afoul of the fragile base class problem.
Both the subclass and the superclass are defined in the same framework.
Plus the private declaration enforces the use of accessors.
So I don't think we gave the cause here.
>
> Alternately, do you have a plugin scheme? ObjC has no namespaces, so if you have two classes of the same name in two plug-ins (or your app and a plug-in, or in two frameworks), the loader will use whichever one got loaded first (which is pretty much random), it will not give each module "its" class of that name. So, if one of these classes is an older version that has a shorter ivar list, subclasses will put their first ivar where they think the base class ends, which is after the shorter ivar list.
Plug-ins abound in my case and I have hit namespace problems before but it doesn't look like the culprit in this case.
The executable in questions is an auxiliary executable included as part of a plugin.
The aux executable in turn links against a framework in the main app bundle.
But I don't see that being the source of the issue.
Still puzzled.
Good suggestions though, thanks.
Jonathan
_______________________________________________
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