Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local variables default to strong or weak?

Lets say I have local variable(not property) Obj *x = d, is d's reference count incremented? Or is it default a weak reference?

like image 738
mskw Avatar asked Jul 28 '15 16:07

mskw


1 Answers

Apple's documentation (Variable Qualifiers section) said:

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.

like image 170
Klevison Avatar answered Sep 25 '22 14:09

Klevison