• 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
Re: Subclass Import Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclass Import Issues


  • Subject: Re: Subclass Import Issues
  • From: Ilan Volow <email@hidden>
  • Date: Fri, 31 Dec 2004 02:50:07 -0500

For the edification of anyone searching the list archives in the future, I found out the problem was that in Child.m I was importing Child.h before Parent.h--silly me. Once I switched the imports around everything worked (I was already using @class in the .h files and doing the imports in the .m files, but @class got snipped out when I cut and pasted the example).

Thanks to everyone for the suggestions, anyways.

On Dec 30, 2004, at 11:13 PM, Ilan Volow wrote:


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:
This email sent to email@hidden


--
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:
This email sent to email@hidden


References: 
 >Subclass Import Issues (From: Ilan Volow <email@hidden>)

  • Prev by Date: Re: How to add a URL-tile to the Dock from an Installer?
  • Next by Date: Bug in NSImageCell scaling?
  • Previous by thread: Re: Subclass Import Issues
  • Next by thread: Is it possible to draw text to an offscreen view that has no window?
  • Index(es):
    • Date
    • Thread