Re: @class
Re: @class
- Subject: Re: @class
- From: Andrea Salomoni <email@hidden>
- Date: Fri, 9 Dec 2005 11:12:03 +0100
Thank you Frederick,
so I can use it in this way:
@class MYClassB
@header MYClassA
{
something
}
@class MYClassA
@header MYClassB
have to use #import "MYClassA.h" in the implemetation of MYClassB?
thank you again
Andrea
Il giorno 09/dic/05, alle ore 10:57, Frederick Cheung ha scritto:
It's for forward declaring classes. @class NSFoo; basically tells the
compiler "there is an (obj-c) class NSFoo, you haven't see the
declaration for it yet but don't worry it's coming later" so that the
compiler won't barf if (for example) you have an instance variable of
type NSFoo*.
You can use it to avoid having to #import the header file that defines
the class into a header (often you would use this to avoid having
circular dependencies (ie A.h imports B.h and B.h imports A.h)
Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >@class (From: Andrea Salomoni <email@hidden>) |
| >Re: @class (From: Frederick Cheung <email@hidden>) |