NSDictionary* result = nil;
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)[self TIFFRepresentation], NULL);
if ( NULL == source )
{
}
else
{
CFDictionaryRef metadataRef = CGImageSourceCopyPropertiesAtIndex (source, 0, NULL);
if (metadataRef)
{
NSDictionary* immutableMetadata = (__bridge NSDictionary *)metadataRef;
if (immutableMetadata)
{
result = [NSDictionary dictionaryWithDictionary : (__bridge NSDictionary *)metadataRef];
}
CFRelease(metadataRef);
metadataRef = nil;
}
CFRelease(source);
source = nil;
}
return result;
我正在将 XCode 与 ARC 一起使用。当我在循环中的许多图像上运行此代码时,此代码会导致我的应用程序泄漏内存。有人知道我做错了什么吗?