I posted this question about dragging content from OS X Finder into an NSTableView
. This all works nicely now. However, if I want to drag URLs from a browser address bar into my app, I first need to drag them to the desktop (where they appear as a .webloc file) and then drag them into my app.
Is there a way to directly drag them from the browser address bar into my app, without having to drag them to the desktop first?
I tried registering kUTTypeURL
but this doesn't seem to work as dragged URLs bounce back to their origin:
[[self sourcesTableView] registerForDraggedTypes:[NSArray arrayWithObjects: (NSString*)kUTTypeFileURL, (NSString*)kUTTypeURL, nil]];