lol, you are correct. The book didn't say this.
You have to include in .M not in .H.

Now I understand how to use the @class. This make sense now.

Thanks.. Now the problem is REALLY solved :P

2011/4/20 Quincey Morris <quinceymor...@earthlink.net>

> 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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to