How do you get the Finder “Kind” for a file?
I want to get the Finder "Kind" for a file. For example, for a file "foo.css", I want the string "CSS style sheet". So far, I'm doing something like this: NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: filename]; NSString *utiType; NSError *error; BOOL success = [fileURL getResourceValue: &utiType forKey: NSURLTypeIdentifierKey error: &error]; if (!success) { NSLog(@"failure during reading utiType: error = %@", error); return; } NSString *utiDescription = (__bridge NSString *) UTTypeCopyDescription((__bridge CFStringRef) utiType); if (utiDescription) { // use utiDescription here... }