Please explain your answers as I’ve gotten away with not having to do this so far.
Thanks
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.
You only import things you need, and @class is doing something similar to #import – it’s letting the compiler know a type exists. So why would you tell the app delegate about a class it will never see?
The difference is:
@classwill only say the class exists, nothing more.#importtells the code what messages the class accepts or anything else the header file declares. So you use it when the code needs to actually send messages to an object.That’s why a very general pattern is to use @class in the header, and #import in the implementation file. Sometimes you do need to import in the header, again if you have to know anything more than “this class exists”.