Re: How call upper layer function
Re: How call upper layer function
- Subject: Re: How call upper layer function
- From: Rodrigo Zanatta Silva <email@hidden>
- Date: Wed, 20 Apr 2011 16:23:56 -0300
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 <email@hidden>
> 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@hidden)
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:
This email sent to email@hidden