• 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: "Recursive" #imports
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Recursive" #imports


  • Subject: Re: "Recursive" #imports
  • From: Wain Glaister <email@hidden>
  • Date: Thu, 14 Jun 2007 19:38:18 +0100

Hi,

You should be able to use @class in the headers (so you can declare variables and method signatures) and then do a #import in the implementations (so you can call methods).

Wain

On 14 Jun 2007, at 19:22, Alain Schartz wrote:

I'm having problems with the #import statement :

I have a ClassA, #import-ing ClassB.h ; and ClassB #import-ing ClassA.h. If I try to compile this, I get parse errors from the compiler, indicating that something is wrong in my header files. I was aware that the #include-statement could generate this kind of problem, but I thought that #import would save me from exactly this kind of thing?

Unfortunately ClassA needs access to ClassB's methods and vice- versa, disqualifying the use of the @class-directive... So I'm kind of stuck here!

Does anyone have a suggestion how to resolve this (besides rewriting my code, that is)?

Thanks,
Alain Schartz
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: "Recursive" #imports
      • From: "A.M." <email@hidden>
References: 
 >"Recursive" #imports (From: Alain Schartz <email@hidden>)

  • Prev by Date: Re: Obtaining unpremultiplied bitmap from PNG file
  • Next by Date: NSColorPicker cusomt minimum view size
  • Previous by thread: "Recursive" #imports
  • Next by thread: Re: "Recursive" #imports
  • Index(es):
    • Date
    • Thread