Matt S.
Matt S.

Reputation: 13753

Cocoa: create drop zone for files

I want to create a drag and drop zone (using an NSView) for ANY file in my cocoa app. How do I do it?

Upvotes: 4

Views: 4343

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Read Drag and Drop Programming Topics for Cocoa. You want your custom view to be a "dragging destination". You'll need to understand the pasteboard and file path pasteboard types, how to subclass a view (a generic NSView for your own custom class, or an existing view like NSImageView) and add the appropriate dragging source methods.

Upvotes: 9

Related Questions