• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dynamic UTIs and 10.6 NSPasteboard APIs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Proper way to create a singleton without @synchronized ?
  • Next by Date: Re: Proper way to create a singleton without @synchronized ?
  • Previous by thread: Re: iOS rotate to interface orientation problem
  • Next by thread: Resolving a crash address to position in code
  • Index(es):
    • Date
    • Thread