以下单例类(SharedManager)帮助器方法可能会导致保留周期.在静态分析器中获取警告:“在线路上分配的对象的潜在泄漏……”我该如何解决?
我确实尝试过使用ivar uuid __weak但是当我分析时仍会出现警告.
NSString *__weak uuid = (__bridge NSString *)CFUUIDCreateString(kcfAllocatorDefault,uuidObject);
谢谢
像这样在课堂上被召唤:
myUUID = [SharedManager generateUUID]; + (NSString *)generateUUID { CFUUIDRef uuidObject = CFUUIDCreate(kcfAllocatorDefault); NSString *uuid = (__bridge NSString *)CFUUIDCreateString(kcfAllocatorDefault,uuidObject); CFRelease(uuidObject); return uuid; }