9

i am trying to get drag and drop working in xcode 3.1.4 on osx/leopard. any pointers or hints or maybe even example code? i cannot find anything out there and it is really disappointing. i want to have the interface respond if files are dragged on the main window.

Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
z3cko
  • 3,054
  • 8
  • 40
  • 59
  • As you didn't tell us which framework you are using, I assumed you are working with Cocoa. I re-tagged your question to reach a broader audience. (Most people check the "Cocoa" tag when searching for Mac OS X programming questions) – Thomas Zoechling Jan 15 '10 at 17:11
  • More to the point, most people check the Cocoa tag when looking for Cocoa questions to answer, and the IDE you're using (Xcode) is quite irrelevant to the solution, which involves the *framework* you're using. – Peter Hosey Jan 16 '10 at 05:05

1 Answers1

16

To register a window or view as a dragging destination, use the registerForDraggedTypes: method of NSWindow or NSView.
You can find further details in the Getting Started with Drag and Drop Programming guide on developer.apple.com

jbrennan
  • 11,943
  • 14
  • 73
  • 115
Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
  • thanks! this is a very good answer, since this also applicable for mac osx leopard. i could only find snow leopard examples and they are fundamentally different! – z3cko Jan 16 '10 at 08:55