There are differences in the behavior of accessor synthesis that depend on the runtime (see also “Runtime Difference”):
For the legacy runtimes,instance variables must already be declared in the @interface block of the current class. If an instance variable of the same name as the property exists,and if its type is compatible with the property’s type,it is used—otherwise,you get a compiler error. For the modern runtimes (see “Runtime Versions and Platforms” in Objective-C Runtime Programming GuIDe),instance variables are synthesized as needed. If an instance variable of the same name already exists,it is used.
iOS总是使用现代运行时,因此您永远不需要显式声明ivars.
总结以上是内存溢出为你收集整理的objective-c – Xcode 4在使用@属性时自动生成iVars,在哪里可以找到此功能的官方文档?全部内容,希望文章能够帮你解决objective-c – Xcode 4在使用@属性时自动生成iVars,在哪里可以找到此功能的官方文档?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)