Reputation: 29896
How does one detect the path of a dragged item(File or Folder)?
Can this path be grabbed when it is dropped in an area?
Upvotes: 0
Views: 89
Reputation: 98984
See Drag and Drop Programming Topics - Receiving Drag Operations for an introduction. When files are dropped, you receive an array of files from the pasteboard. An excerpt from the examples:
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
NSPasteboard *pboard;
NSDragOperation sourceDragMask;
sourceDragMask = [sender draggingSourceOperationMask];
pboard = [sender draggingPasteboard];
if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {
NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];
// ...
Upvotes: 2