Think about it: NSMutableString is a subclass of NSString . When your property is declared as NSString , you do not expect it to change.
Keep in mind that if you used retain and someone gave you NSMutableString and then changed it, your class will be broken.
However, you may think that copy always slower. Therefore, NSString copy simply calls retain . NSMutableString copy makes the actual copy.
Itβs usually best to spit out NSString * because people donβt have to copy them all the time.
kizzx2
source share