1/3,
objectivec
@property (nonatomic, strong) NSString* strA;
@property (nonatomic, strong) NSString* strB;
self.strA = @"strA";
self.strB = self.strA;
self.strA = nil;
NSLog(@"self.strB 的值是%@", self.strB);
// self.strB 的值是strA
2/3,
objectivec
@property (nonatomic, strong) NSString* strA;
@property (nonatomic, weak) NSString* strB;
self.strA = @"strA";
self.strB = self.strA;
self.strA = nil;
NSLog(@"self.strB 的值是%@", self.strB);
// self.strB 的值是strA
3/3
objectivec
@property (nonatomic, strong) NSString* strA;
@property (nonatomic, weak) NSString* strB;
self.strA = [NSMutableString stringWithString: @"strA"];
self.strB = self.strA;
self.strA = nil;
NSLog(@"self.strB 的值是%@", self.strB);
// self.strB 的值是(null)