copy cannot be modified,strong can be modified to prevent the string from being accidentally modified. Demo: —————————————————— Code The demo you want —————————————————— @property ( nonatomic, copy) NSString * copystring; @property (nonatomic, strong) nsstring *strongstring; nsmutablestring *string = [nsmutablestring stringwithstring:@ "a"];
self.copystring = string;
self.strongstring = string;
[String appendString: @ "B"];
NSLog (@ "copystring:%@--strongstring:%@", self.copystring, self.strongstring);//Opystring:a--strongstring:ab ------------------------------------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------< Span style= "COLOR: #454545" >--------------
NSString Property Why use copy without strong