我有一个静态方法定义如下:
+(NSString*)getNewIdAsBase64
{
// Grab new uuid
CFUUIDRef originalUuid = CFUUIDCreate(nil);//create a new UUID
//NSLog(@"Step a: original uuidObj = %@",originalUuid);
CFUUIDBytes originalBytes = CFUUIDGetUUIDBytes (originalUuid);//ISSUE
NSData* data88 = [NSData dataWithBytes: &originalBytes length: sizeof(originalBytes)];
NSString* hugo = [data88 base64EncodedString];
return hugo;
}
当我在我的项目上运行 Product->Analyze 时,用 //ISSUE 注释的行会引发以下问题:
Potential leak of an object alocated on line 23 and stored into 'originalUuid'
我做错了什么,我该如何解决?
谢谢