Possible Duplicate:
@class May I know the proper use of this
I am wondering why @class is used. I have a general understanding that it allows you to access things in that class you call, however I don’t know the benefit of it..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
@classdirective sets up a forward reference to another class. It tells the compiler that the named class exists, so when the compiler gets to, say an@propertydirective line, no additional information is needed, it assumes all is well and plows ahead.For example, this code would work fine on it’s own:
But, say we want to avoid circularly including these headers (E.G.
CFExampleClassimportsMyExampleClassandMyExampleClassimportsCFExampleClass), then we can use@classto tell the compiler thatMyExampleClassexists without any complaints.