Pregunta

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

¿Fue útil?

Solución

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

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top