• 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
cross inclusion with fully qualified types in interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cross inclusion with fully qualified types in interface


  • Subject: cross inclusion with fully qualified types in interface
  • From: Greg Hoover <email@hidden>
  • Date: Wed, 5 Apr 2006 19:29:51 -0700

It is my understanding the #import prevents multiple inclusion, however I have run into the following situation that I have been unable to discern. Given two cocoa objects with header files:

// File a.h
#import "b.h"

@interface a : NSObject {
	b *foo;
}
@end

// File b.h
#import "a.h"

@interface b :NSObject {
	a *bar;
}
@end

GCC generates a parse error before foo and bar. However if the fully qualified type declarations are replaced by 'id', the source compiles without incident. In my previous experience, protecting header files was sufficient to prevent, what looks like a multiple inclusion issue. However, even after protecting the header files (which I understand is unnecessary when using #import), I still run into this problem.

Any information would be much appreciated.

Thank You.

GH
_______________________________________________
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


  • Follow-Ups:
    • Re: cross inclusion with fully qualified types in interface
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: NSEqualRects returns wrong answer
  • Next by Date: Re: cross inclusion with fully qualified types in interface
  • Previous by thread: Re: Thread safety issue...
  • Next by thread: Re: cross inclusion with fully qualified types in interface
  • Index(es):
    • Date
    • Thread