• 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: Strange compile time error message...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange compile time error message...


  • Subject: Re: Strange compile time error message...
  • From: Keith Duncan <email@hidden>
  • Date: Fri, 1 Dec 2006 08:12:40 +0000

You shouldn't import a header into another header (unless you are subclassing), instead use the @class XYZ directive to let the compiler know that XYZ is a class. It then expects you to define it later, i.e. when importing the header into the implementation file.

See http://www.cocoadev.com/index.pl?AdviceOnImportingHeaders for more info.


On 30 Nov 2006, at 23:55, Ryan Poling wrote:

I have been getting a strange compile time error message in a Cocoa
project I'm working on.  When I import header file "A.h" into header
file "B.h", I get the following two error messages in "B.m":

error: parse error before 'MyHeader'
fatal error: method definition not in @implementation context

If I instead import "A.h" into "B.m" (instead of into "B.h"), the errors
disappear and everything compiles normally.


"A" is a singleton class, and "B" isn't.

Not sure if that's enough detail for anyone to help...

Any ideas?

Thanks,

-Ryan


_______________________________________________

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:
40mac.com


This email sent to email@hidden

_______________________________________________

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(2): Strange compile time error message...
      • From: "Ryan Poling" <email@hidden>
  • Next by Date: Re: NSImage TIFFRepresentation memory leak
  • Next by thread: Re(2): Strange compile time error message...
  • Index(es):
    • Date
    • Thread