trying to add images
This commit is contained in:
parent
555e7cca3c
commit
a128e0278d
17 changed files with 369 additions and 31 deletions
27
Mac/MimeType.m
Normal file
27
Mac/MimeType.m
Normal file
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// MimeType.m
|
||||
// Tentia
|
||||
//
|
||||
// Created by Jeena on 23/11/2012.
|
||||
//
|
||||
//
|
||||
|
||||
#import "MimeType.h"
|
||||
|
||||
@implementation MimeType
|
||||
|
||||
+(NSString *)mimeTypeForFileAtPath:(NSString *)path error:(NSError **)err {
|
||||
NSString *uti, *mimeType = nil;
|
||||
|
||||
if (!(uti = [[NSWorkspace sharedWorkspace] typeOfFile:path error:err]))
|
||||
return nil;
|
||||
if (err)
|
||||
*err = nil;
|
||||
|
||||
if ((mimeType = (NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)uti, kUTTagClassMIMEType)))
|
||||
mimeType = NSMakeCollectable(mimeType);
|
||||
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
@end
|
Reference in a new issue