Objective c Cocoa:namesOfPromisedFilesDroppedAtDestination只返回一个文件
我正试图得到一份承诺的文件。在方法中:Objective c Cocoa:namesOfPromisedFilesDroppedAtDestination只返回一个文件,objective-c,macos,cocoa,nsoutlineview,Objective C,Macos,Cocoa,Nsoutlineview,我正试图得到一份承诺的文件。在方法中: - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index (info当然是NSDraggingInfo) 当我从Outlook for Mac等应用程序的多个文件中拖动时,namesOfPromisedFilesDroppedAtDestinati
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
(info
当然是NSDraggingInfo
)
当我从Outlook for Mac等应用程序的多个文件中拖动时,namesOfPromisedFilesDroppedAtDestination
的行为与预期的一样,“filenames”数组可以容纳尽可能多的项
但是,当我从Chrome中拖动项目(例如Gmail附件,是的,这是可能的)-我看到pboard.pasteboardItems
确实包含所有附件,但是namesOfPromisedFilesDroppedAtDestination
只返回一个项目
你知道怎么解决这个问题吗
万分感谢
Nili该方法的实现取决于“源”,并且似乎不允许将多个附件写入磁盘,即使您可以拖动它们。这是独立的为什么要使用承诺而不仅仅是普通文件?我建议转储您的源提供的类型,可能有一种更合适。所以我无能为力?因为您无法修改源,所以不:(
NSArray *filenames = [info namesOfPromisedFilesDroppedAtDestination:[NSURL fileURLWithPath:path]]