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                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to