• 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: import statement issues - SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: import statement issues - SOLVED


  • Subject: Re: import statement issues - SOLVED
  • From: Andrew Kinnie <email@hidden>
  • Date: Thu, 3 Apr 2003 18:18:08 -0500

Yes, this worked.

Thanks to the several people who pointed this out, I wish the @class directive was better documented. Oh well.

Andrew


On Thursday, April 3, 2003, at 05:59 PM, Peter Fischer wrote:

Andrew-
I'm a bit of a cocoa newbie, so take my advice with a grain of salt. It appears like you have dependancy issue, i.e. x depends on y, and y depends on x. If each one depends on the other, the compiler is not able to fully parse Hex.h or Force.h without referencing one another. To get around this, you can do a forward declaration. For example.

In Force.h

@class Hex;
@interface Force : NSObject
{
Hex *hex;
...

in Hex.h

@class Force;
@interface Hex : NSObject
{
Force *force;
...

In Force.m import Hex.h, and in Hex.m import Force.h. As long the instance variables are pointers, you should have no problems.

--Pete
_______________________________________________
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: 
 >Re: import statement issues (From: Peter Fischer <email@hidden>)

  • Prev by Date: Re: import statement issues
  • Next by Date: NSTask autorelease OR retain/release -> SIGBUS
  • Previous by thread: Re: import statement issues
  • Next by thread: Re: import statement issues
  • Index(es):
    • Date
    • Thread