Dynamic UTIs and 10.6 NSPasteboard APIs
Dynamic UTIs and 10.6 NSPasteboard APIs
- Subject: Dynamic UTIs and 10.6 NSPasteboard APIs
- From: Sean McBride <email@hidden>
- Date: Mon, 18 Apr 2011 12:07:54 -0400
- Organization: Rogue Research Inc.
Hi all,
I'm trying to use the new 10.6 NSPasteboard APIs. In NSPasteboard.h
there's a section "The recommended approach for reading URLs" which is
what I'm using.
I'm trying to allow drops of any flat file URL (no folders, packages,
volumes, http URLs, ftp URLs, etc.).
So I use kUTTypeData for which the docs say "The type identifier for any
sort of simple byte stream, including files":
NSArray* classes = [NSArray arrayWithObject:[NSURL class]];
NSArray* UTIs = [NSArray arrayWithObject:
(NSString*)kUTTypeData];
NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],
NSPasteboardURLReadingFileURLsOnlyKey,
UTIs,
NSPasteboardURLReadingContentsConformToTypesKey,
nil];
NSArray* fileURLs = [self readObjectsForClasses:classes
options:options];
this works mostly, but not for some files. The distinguishing factor
seems to be that some files are getting 'dynamic UTIs', ex:
$ mdls -name kMDItemContentType /path/to/file.ext
kMDItemContentType = "dyn.ah62d4rv4ge81a5d3"
What gives? Why do some files get these dynamic UTIs? Is
NSPasteboardURLReadingContentsConformToTypesKey therefore useless?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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