__weak NSString *strin = [[NSString alloc] initWithFormat:@"hey"] ;
NSLog(@"weak %@",strin); //returns weak (null)
__weak NSString *strin =@"hey";
NSLog(@"weak %@",strin); //returns weak hey
这两个片段有什么区别。为什么第二个在分配弱时返回值?
__weak NSString *strin = [[NSString alloc] initWithFormat:@"hey"] ;
NSLog(@"weak %@",strin); //returns weak (null)
__weak NSString *strin =@"hey";
NSLog(@"weak %@",strin); //returns weak hey
这两个片段有什么区别。为什么第二个在分配弱时返回值?