最新 Objective-C 關聯物件 AssociatedObject 原理

LzhSweeterSmile發表於2020-11-28
AssociationsManager
AssociationsHashMap <DisguisedPtr<objc_object>, ObjectAssociationMap>
ObjectAssociationMap <const void *, ObjcAssociation>
ObjcAssociation {uintptr_t _policy,id _value}

objc_setAssociatedObject(self, @selector(name), name, OBJC_ASSOCIATION_COPY_NONATOMIC);

DisguisedPtr<objc_object> :self
const void * : @selector(name)
_value : name
_policy : OBJC_ASSOCIATION_COPY_NONATOMIC

 

相關文章