开发者

MacOSX Promised files drag&drop howto?

开发者 https://www.devze.com 2023-01-15 18:54 出处:网络
It\'s not clear to me how to do drag&drop to Finder with dragPromisedFilesOfTypes:fromRect:source:slideBack:event: (NSCollectionView)

It's not clear to me how to do drag&drop to Finder with

dragPromisedFilesOfTypes:fromRect:source:slideBack:event: (NSCollectionView)

I call the above method from mouseDown:, bu开发者_如何学Got

(NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination 

isn't called at all.

Any ideas how this should work (MacOSX 10.6, project compiled for 10.5, 64bit)?

Thanks!


I had missed one method implementation: (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal. This solved the issue.


Have you already looked at the Drag and Drop Programming Topics? This whole book is on drag & drop, and it has a section specifically on file promises.

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html#//apple_ref/doc/uid/20001288-102943

0

精彩评论

暂无评论...
验证码 换一张
取 消