Whats the difference between variable declared in interface (in ".h" file) and in implementation in (in .m file)??开发者_C百科
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.
精彩评论