• 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
Re: filtering drag and drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filtering drag and drop


  • Subject: Re: filtering drag and drop
  • From: Izidor Jerebic <email@hidden>
  • Date: Fri, 7 Sep 2001 11:09:49 +0200

On Friday, September 7, 2001, at 09:57 AM, Mike Margolis wrote:


[NSArray arrayWithObject: NSFilenamesPboardType];

It accepts everything. If i change it to

[NSArray arrayWithObject: NSTIFFPboardType];

it doesnt accept anything, not even tiffs, tiffs with.tiff extensions, tiffs with .tif extension, none of them. I tried hard coding an array of @"TIFF", @"tiff", @"tif ", etc.. still nothing. I cant seem to find in the documentation what exactly registerForDraggedTypes should take in besides these prefabricated NSTIFFPboardType, etc stuff...


Those types in NSArray are pasteboard types, not file types. These types tell you what type of data is within the pasteboard. A pasteboard can contain different data for different types at the same time, so if you drag a tiff file, an application may put a filename with Filenames type and also picture contents into the same pasteboard with TIFF type. But that depends on application which initiates dragging. For dragging files, the contents of pasteboard are generally only filenames.

I think that if you want to accept only files of certain type, you will have to filter them yourself within your drag'n'drop methods.

izidor


References: 
 >filtering drag and drop (From: Mike Margolis <email@hidden>)

  • Prev by Date: disable options in finder
  • Next by Date: Locking Files?
  • Previous by thread: filtering drag and drop
  • Next by thread: HELP How to open a default document at startup
  • Index(es):
    • Date
    • Thread