I think the result under the second example below should be "null", but after I run the code, I found that in Example 1 the output is "Strong-String" and in Example 2 it's "null"
I really don't understand why this is.
Examples:
// property definition
@property (nonatomic, strong) NSString *strongStr;
@property (nonatomic, weak) NSString *weakString;
// Sample 1
self.strongStr = @"Strong-String";
self.weakString = self.strongStr;
self.strongStr = nil;
// output -> Strong-String
NSLog(@"waekstring = %@", self.weakString);
// Sample 2
self.strongStr = [[NSString alloc] initWithUTF8String:"Strong-String"];
self.weakString = self.strongStr;
self.strongStr = nil;
// output -> null
NSLog(@"waekstring = %@", self.weakString);