On Apr 20, 2011, at 11:34, Rodrigo Zanatta Silva wrote:
> //Finally in "LevelDown.m" i have
> #import "LevelDown.h"
>
> @implementation LevelDown
> - (id)initWithLevelUp: (LevelUp *)levelUp; {
> self = [super init];
> LevelUp* myLevelUp = levelUp;
> [myLevelUp doSomething]; //Everything work, but this will give-me a
> problem
> return self;
> }
> @end
You need:
> #import "LevelDown.h"
> #import "LevelUp.h"
>
> @implementation LevelDown
> - (id)initWithLevelUp: (LevelUp *)levelUp; {
> self = [super init];
> LevelUp* myLevelUp = levelUp;
> [myLevelUp doSomething]; //Everything work, but this will give-me a
> problem
> return self;
> }
> @end
The @class solves the circular reference in the .h files, but you must still
include the actual interface in any compilation unit that uses the class.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]