Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclass Import Issues




I'm having a problem with an import that's really knocking me for a loop.


To simply things, I'll say I have two classes: Parent and Child. Not only is Parent the superclass of Child, but it also contains an instance of Child.

The .h files look like this

--Parent.h

#import "Child.h"

@interface Parent
{
	Child *myChild;
}

--Child.h

#import "Parent.h"

@interface Child : Parent
{

}

When I try building the thing, I get various parse errors because of (I believe) recursive imports. I've tried the standard way of getting around recursive importing problems by using the @class thing in the .h file and then doing the import in the .m file, and that doesn't seems to work in this case.

While I would agree with anyone that this problem is really hinting at a redesign, I'm following someone else's spec and I don't have much choice in the matter. So if anyone would have any suggestions about how I could get around this, it would be much appreciated.



--
Ilan Volow
Ergonomica Auctorita Illico!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.