开发者

variable declaration in iphone

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜