Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top