It was all about remembering to keep copy and strong and asking me. I don't know what I'm talking about.
Verify with simple code. Sometimes it takes a little time to verify that you can make your ideas clearer.
nsmutablestring * mustr = [nsmutablestring stringwithstring:@ "good"];
Self . str = mustr;
Self . fuzhistring = mustr;
NSLog(@ "Self.str is (%@) = = = Str,self.fuzhistring is (%@)", self. Str,self. Fuzhistring);
NSLog(@ "Self.str *p is (%@) = = = Str,self.fuzhistring *p is (%@)", self. Str,self. Fuzhistring);
Note: Print results = = Self.str is (good) = = Str,self.fuzhistring is (good)
Self.str *p is (0x600000059350) = Str,self.fuzhistring *p is (0xa000000646f6f674)
[Mustr appendString:@ "Night"];
NSLog(@ "Self.str is (%@) = = = Str,self.fuzhistring is (%@)", self. Str,self. Fuzhistring);
NSLog(@ "Self.str *p is (%@) = = = Str,self.fuzhistring *p is (%@)", self. Str,self. Fuzhistring);
Note: printing results ==self.str is (goodnight) = Str,self.fuzhistring is (good)
Self.str *p is (0x600000059350) = Str,self.fuzhistring *p is (0xa000000646f6f674)
Print Result: Copy Modifier's property is deep copy (opens a new memory to point to a new value)
The properties of the strong modifier are light copy (which changes with the value of MUSTR);
Also indicates that the string in order to prevent inadvertent modification should use copy, develop good habits.
Of course, there's no difference between using copy and strong with NSString.
The difference between a deep copy and a shallow copy of iOS and copy and strong