简体   繁体   English

Objective-C中的任何内容都在幕后使用关联引用吗?

[英]Does anything in Objective-C use associative references under the hood?

Does anything in Objective-C use associative references under the hood? Objective-C中的任何内容都在幕后使用关联引用吗? For example, do property setter and getter use it behind the scene? 例如,属性设置器和获取器在后台使用它吗?

No. That would be much too slow. 不,那太慢了。

Some classes in Cocoa use them, but nothing in ObjC itself. 可可中的某些类使用它们,但ObjC本身中不使用任何类。

I would think associative references would be used explicitly by developers extending exiting classes. 我认为关联引用将由扩展现有类的开发人员显式使用。 When the compiler generates getters and setters it has access to the source code. 编译器生成getter和setter时,可以访问源代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Objective-C-KVC如何在后台运行? - Objective-C - How does KVC work under the hood? Objective-C 运行时版本是否会为用户保留关联引用? - Will Objective-C runtime release retained associative references for user? 伪造具有关联引用的Objective-C类别中的实例变量 - 错误“使用未声明的标识符'OBJC_ASSOCIATION_RETAIN” - Faking instance variables in Objective-C categories with Associative References - Error “Use of undeclared identifier 'OBJC_ASSOCIATION_RETAIN” 如何在Swift 3中(幕后)实现转义的闭包? 是否像在Objective-C中一样隐式地复制/保留了它们? - How are escaping closures implemented in Swift 3 (under the hood)? Are they implicitly block_copied/retained like in objective-c? Objective-C,引用的属性 - Objective-C, properties for references 仅仅符合Objective-C协议会做任何事情吗? - Does simply conforming to an Objective-C protocol do anything? Objective-C块 - 阻止保留它引用的对象吗? - Objective-C blocks - does block retain the object it references? Objective-C是否禁止使用结构? - Does Objective-C forbid use of structs? 苹果为什么使用Objective-C? - Why does Apple use Objective-C? Objective-C是否使用字符串池? - Does Objective-C use string pooling?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM