where do you define a struct in an objective-C class. The header file?
Sorry if this is a total noob question, Thanks in advance.
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.
I tell you a little secret: ‘id’ type is pointer to the structure. So you actually using them all the time. However sometimes it is more convenient to use plain C structures:
So as Objective C is the superset of C all the rules from C are applied to Objective C. It means you can declare struct everywhere, where C allows it: in the header if you want this struct to be public or in an implementation file.