#import "ViewController.h"
@interface ViewController ()
@property(nonatomic, strong) NSString *str_strong;
@property(nonatomic, copy) NSString *str_copy;
@property(nonatomic, copy) NSMutableString *mulStr_copy;
@property(nonatomic, strong) NSMutableString *mulStr_strong;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// NSString *str_ori = [NSString stringWithFormat:@"%@", @"abc"];
// self.str_copy = str_ori;
// self.str_strong = str_ori;
// NSLog(@"str_orin:%p---str_strong:%p---str_copy:%p", str_ori, self.str_strong, self.str_copy);
NSMutableString *str_ori = [NSMutableString stringWithString:@"abc"];
self.str_copy= str_ori;
self.str_strong= str_ori;
self.mulStr_copy= str_ori;
self.mulStr_strong= str_ori;
[str_oriappendString:@"123"];
NSLog(@"str_orin:%p---str_strong:%p---str_copy:%p---mulStr_copy:%p---mulStr_strong:%p", str_ori, self.str_strong, self.str_copy, self.mulStr_copy, self.mulStr_strong);
[self.mulStr_strong appendString:@"qwe"];
NSLog(@"str_orin:%@---str_strong:%@---str_copy:%@---mulStr_copy:%@---mulStr_strong:%@", str_ori, self.str_strong, self.str_copy, self.mulStr_copy, self.mulStr_strong);
}
@end
str_orin:0x28374b750---str_strong:0x28374b750---str_copy:0x9813e34ba0e708c7---mulStr_copy:0x9813e34ba0e708c7---mulStr_strong:0x28374b750
str_orin:abc123qwe---str_strong:abc123qwe---str_copy:abc---mulStr_copy:abc---mulStr_strong:abc123qwe
strong: value + p; copy:value