I have an NSWindow containing and NSImageView. I want that the user can drag 'n drop a .app file (application) into the NSImageVie开发者_JS百科w, and my application see which file is dropped. Is there a way to do this (okay, I'm sure there is a way to do this -_- but which one :p )?
So much like iWeb does it with image files.
A tutorial would be nice (english or dutch).
Thanks in advance.
- Subclass NSImageView
- Implement NSDraggingDestination protocol
- Register an instance of your subclass to accept your defined PBoardType
Here is a well written tutorial (it's a bit old, but maybe useful): http://www.cocoadevcentral.com/articles/000056.php
精彩评论