开发者

Objective-C: Associative Object Behaviors

开发者 https://www.devze.com 2023-03-18 20:31 出处:网络
Does OBJC_ASSOCIATION_RETAIN_NONATOMIC of the Associative Object Behaviors in t开发者_JAVA百科he Objective-C Runtime Reference, call release on the old value referenced by the associated object before

Does OBJC_ASSOCIATION_RETAIN_NONATOMIC of the Associative Object Behaviors in t开发者_JAVA百科he Objective-C Runtime Reference, call release on the old value referenced by the associated object before it assigns & retains the new value?


Yes. If you use the retain or copy behaviors when associating the value, then that value will be released when either a new value is associated (regardless of the behavior attached to the new value), or the object itself is deallocated.

0

精彩评论

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