문제

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