Search code examples
objective-ccocoa-touchautomatic-ref-countingdeclared-property

Should an NSString property under ARC be strong or copy?


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?


Solution

  • 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.