开发者

variable declaration in iphone

开发者 https://www.devze.com 2023-02-11 08:45 出处:网络
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 bloc

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消