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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to