File UTI on 10.6.8
File UTI on 10.6.8
- Subject: File UTI on 10.6.8
- From: Martin Hewitson <email@hidden>
- Date: Tue, 03 Jan 2012 08:57:53 +0100
Dear list,
I want to check if a file extension is registered as a text file. So I made a little category method on NSString like this:
- (BOOL)isText
{
BOOL fileIsText = NO;
CFStringRef fileExtension = (CFStringRef) self;
CFStringRef fileUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileExtension, NULL);
if (UTTypeConformsTo(fileUTI, kUTTypeText)) {
fileIsText = YES;
}
CFRelease(fileUTI);
return fileIsText;
}
This works fine on 10.7. On 10.6.8 when
self = @"tex"
this returns NO and fileUTI is dyn.age81k3p2.
Anybody got an idea what this dyn.* means?
Cheers,
Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden