week reference to autoreleased object not getting deallocated in case of NSString
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Why temp object is not released and set to nil even though it is declared as __week . But in case of Person object its working as expected. Do NSString objects memory life cycle is handled differently? How? @interface Person : NSObject @property(nonatomic, strong) NSString *name; - (instancetype)initWithName:(NSString *)name; + (Person *)personWithName:(NSString *)name; @end @implementation Person - (instancetype)initWithName:(NSString *)name { if (self = [super init]) { self.name = name; } return self; } + (Person *)personWithName:(NSString