Re: filtering drag and drop
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