So, I had a similar circular warning for this same method where I wanted to identify a JPG or a PNG image and create an image with the appropriate extension. Although a good example of how to use it was not clear to me and here's what worked for me (Objective C).
Import the newer identifiers:
@import UniformTypeIdentifiers;
Create a property to hold the identifiers:
@property (strong) NSString *imageType;
Assign one of the identifiers to the property:
if ([theImageExtension isEqualToString:@"png"]) {
_imageType = (NSString *)UTTypePNG.identifier;
} else {
_imageType = (NSString *)UTTypeJPEG.identifier;
}
Use it:
CGImageDestinationRef destinationRef = CGImageDestinationCreateWithURL((__bridge CFURLRef)theURL, (CFStringRef)_imageType, 1, NULL);
And that worked! (after many permutations)
Topic:
Media Technologies
SubTopic:
Audio
Tags: