Re: NSTableView Drag and Drop doesn't work
Re: NSTableView Drag and Drop doesn't work
- Subject: Re: NSTableView Drag and Drop doesn't work
- From: Corbin Dunn <email@hidden>
- Date: Tue, 17 Mar 2009 09:05:22 -0700
On Mar 17, 2009, at 8:41 AM, Jushin wrote:
I did further investigation and found the reason.
It was because the problem of "regsterForDraggedTypes"
I just wanted to filter out images, so I used following to define
types:
NSArray* types = (NSArray*)CGImageSourceCopyTypeIdentifiers();
and then set it as,
[tableView registerForDraggedTypes:types];
It didn't work. I only could make it work after I changed this to:
[tableView registerForDraggedTypes:[NSArray
arrayWithObjects:NSFilenamesPboardType,nil]];
So, how can I filter image files for drag and drop?
You will have to do some sort of validation in -validateDrop -- ie,
grab the filename(s), and make sure they have an extension or UTI that
matches what you want.
corbin
_______________________________________________
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