• 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
Newbie: Include file Loop!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie: Include file Loop!


  • Subject: Newbie: Include file Loop!
  • From: Jay Prince <email@hidden>
  • Date: Tue, 24 Sep 2002 14:17:06 -0700

I've got a situation that I'm sure is from stupidity on my part.

I've got two objects: Foo and Bar. Each wants a pointer to the other so they can send messages back and forth. They are truly peers and need to send multiple messages back and forth.

I have:

#import "Bar.h"
@interface Foo : NSObject
Bar * myBar;
@end

#import "Foo.h"
@interface Bar: NSObject
Foo * my Foo;
@end

So, of course when building I get:
Foo.h:18: undefined type, found `Bar'
from Foo.m:10:
In file included from Bar.h:4,
Foo.h:18: parse error before "Bar"

Neither header can be compiled because it depends on the other, and when the compiler gets to the part of a header referencing the other header (in the process of processing the other header) it chokes.

Is there a solution to this, or do I just need to call them ids and get on with my life?

Jay

PS I was unable to find this on masam, but given its nature it's a difficult search.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Incomplete libstd? (From: Bruno Blondeau <email@hidden>)

  • Prev by Date: Re: How to make DO not do transformations
  • Next by Date: Re: Newbie: Include file Loop!
  • Previous by thread: Incomplete libstd?
  • Next by thread: Re: Newbie: Include file Loop!
  • Index(es):
    • Date
    • Thread