I am wondering, what specifically @interface section of a header file should hold?
From the examples i saw it seems that it is used to declare instance variables. Accessors and other methods seem to be outside of it.
Please clarify
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.
@interfacehas at least two contexts: declaring a class and declaring a category. A class declaration looks like the following (with the bracketed stuff being optional):A category declaration looks roughly the same, but has no fields zone:
So, the
@interfaceline must be followed by braces in the case of a class declaration, and the fields of the class should be enclosed within. You put methods after the braces.