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.
Question
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?
La solution
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.