局部变量默认是强还是弱?

msk*_*skw 5 objective-c ios automatic-ref-counting

假设我有局部变量(不是属性)Obj *x = d,d 的引用计数是否增加了?或者它是默认的弱引用?

Kle*_*son 6

苹果的文档(Variable Qualifiers部分)说:

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

__strong是默认值。只要有一个指向它的强指针,一个对象就会保持“活着”。