문제

Is there a way how to get MIME type for ALAsset? There is a nice method for metadata:

NSDictionary *data = [[asset defaultRepresentation] metadata];

But that doesn't contain MIME type data...

도움이 되었습니까?

해결책

ALAssetRepresentation *rep = [asset defaultRepresentation];

NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass
             ((__bridge CFStringRef)[rep UTI], kUTTagClassMIMEType);

This will give you the MIME type. You need to add MobileCoreService framework and import <MobileCoreServices/MobileCoreServices.h>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top