Whats the difference between variable declared in interface (in “.h” file) and in implementation in (in .m file)??
Whats the difference between variable declared in interface (in .h file) and in implementation
Share
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.
Data declared inside the brackets in an @interface { … } … @end block is an instance variable of the class. Data declared (at global scope) inside a .m file is app-global data. There is nothing magic about .h versus .m files, .h files are just usually #import’ed into .m files. The important thing is whether the data is insdide an @interface { … } … @end. So too, data in a .h file declared outside of @interface will be at app global scope.