gpt4 book ai didi

objective-c - 新的 Apple LLVM 4.0 "default synthesize"功能如何运作?

转载 作者:太空狗 更新时间:2023-10-30 04:00:22 27 4
gpt4 key购买 nike

我在浏览 Xcode 4.4 的发行说明时注意到了这一点:

LLVM 4.0 Compiler

Xcode now includes the Apple LLVM Compiler version 4.0, including the following newObjective-C language features:

  • Default @synthesize: automatically synthesizes an @property when unimplemented

我对这个功能很感兴趣。它是如何工作的?我试过删除 @synthesize,但没用。

最佳答案

它确实有效,请确保在您的项目和目标设置中将编译器设置为 LLVM 4.0。然后,当您删除 @synthesize 行时,您可以通过两种方式访问​​它:

通过带有 self.myProperty 的访问器或通过带有 _myProperty 的相应实例变量(是的,下划线是自动添加的)。

关于objective-c - 新的 Apple LLVM 4.0 "default synthesize"功能如何运作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11670715/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com