When not compiling with ARC, it is recommended to use copy
properties for data types such as NSString
. I could not find proper documentation on the use of copy
in ARC mode. Can someone tell me what's applicable for ARC?
strong / retain : Declaring strong means that you want to “own” the object you are referencing. Any data that you assign to this property will not be destroyed as long as you or any other object points to it with a strong reference.
strong (default) Strong just means you have a reference to an object and you will keep that object alive. As long as you hold that reference to the object in that property, that object will not be deallocated and released back into memory.
It is still recommended to copy because you want to avoid something passing a mutable string and then changing it without you knowing. A copy guarantees that the string you have will not change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With