質問

Apple's Clipboard Viewer app is tremendously helpful when implementing copy and paste. I'd like to have a similar thing for drag and drop, but I'm not sure how to start.

Normally the first step to implementing a drop target is to have your NSView call -registerForDraggedTypes. Is there any way to declare that you want to receive all possible types of drops? Or is there a lower-level API that one could use to get the pasteboard without needing to specifically register first?

役に立ちましたか?

解決

I'm not 100% sure it works really in all cases but I have successfully be using something like:

[self registerForDraggedTypes: @[(NSString*)kUTTypeItem]];

Also look up th eother type items.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top