Re: import statement issues - SOLVED
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.