Question

I am trying to DnD a promised file. In the method:

- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index

When I see my pboard is of type NSFilesPromisePboardType, I do:

NSArray *filenames = [info namesOfPromisedFilesDroppedAtDestination:[NSURL fileURLWithPath:path]]

(info is NSDraggingInfo of course).

When I drag from multiple files from applications such as Outlook for Mac, etc, namesOfPromisedFilesDroppedAtDestination behaves as expected and "filenames" array holds as many items as it should.

However, when I drag items from Chrome (such as Gmail attachments, yes, it's possible) - I see that pboard.pasteboardItems does hold all the attachments, however namesOfPromisedFilesDroppedAtDestination returns only one item!

Any idea on how to fix this?

Thanks a million,

Nili

Was it helpful?

Solution

the implementation of that method depends on the 'source' and it seems that it doesn't allow to write multiple attachments to disk -- even though you can drag them. this is independent

OTHER TIPS

Why are you using promises instead of just normal files? I would recommend dumping the types that your sources are providing, there might be one much more appropriate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top