gpt4 book ai didi

ios - 局部变量默认为强还是弱?

转载 作者:可可西里 更新时间:2023-11-01 17:05:38 24 4
gpt4 key购买 nike

假设我有局部变量(不是属性)Obj *x = d,d 的引用计数是否递增?还是默认为弱引用?

最佳答案

Apple 的文档(Variable Qualifiers 部分)说:

https://developer.apple.com/library/ios/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

__strong is the default. An object remains “alive” as long as there is a strong pointer to it.

关于ios - 局部变量默认为强还是弱?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31682334/

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