• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
subclass overwriting superclass ivar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subclass overwriting superclass ivar


  • Subject: subclass overwriting superclass ivar
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 26 May 2010 12:40:08 +0100

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.

Moving tempFilePath up the ivar list resolves the problem (though doubtless creates another).
Moving ivar stderrData into the superclass also resolves it.

Does the problem lie in the interface declarations below or are things likely going astray at run time?

Note that gdb now includes improved support for watching ivars: (gdb) watch -location self->ivar

@interface MGS_A : NSObject <NSApplicationDelegate> {

@private
	int argc;
	const char **argv;
	NSDictionary *taskDict;
	NSString *error;
	NSInteger errorCode;
	NSMutableDictionary *errorInfo;
	NSMutableDictionary *replyDict;
	int stdoutSaved;
	id resultObject;
	id scriptObject;
	NSString *scriptExtension;
	NSString *scriptSourceExtension;
	MGSScriptExecutorManager *scriptExecutorManager;
	NSString *tempFilePath;
}

@interface MGS_B : MGS_A {
@private
	NSData *stderrData;
}

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com







_______________________________________________

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

  • Follow-Ups:
    • Re: subclass overwriting superclass ivar
      • From: Greg Parker <email@hidden>
    • Re: subclass overwriting superclass ivar
      • From: Uli Kusterer <email@hidden>
    • Re: subclass overwriting superclass ivar
      • From: Joanna Carter <email@hidden>
    • Re: subclass overwriting superclass ivar
      • From: vincent habchi <email@hidden>
  • Prev by Date: iPad animations are backwards for some orintations.
  • Next by Date: OutlineView Wierdness - 'item' not being stored.
  • Previous by thread: Re: iPad animations are backwards for some orintations.
  • Next by thread: Re: subclass overwriting superclass ivar
  • Index(es):
    • Date
    • Thread