views:

46

answers:

1

How can I create draggable zones in cocoa and be able to drag and drop images between the two.

Ex:

Zone 1:no image

Zone 2:image

drag zone 2's image to zone 1, and be able to save (core data) the location of the image.

Would I have to do something like this: http://developer.apple.com/Mac/library/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html ?

+1  A: 

Yes, you've answered your own question. You need to implement the various protocols that are described in the documentation you referenced.

You could just use two NSImageView objects and make them editable. Editable NSImageView objects allow drag and drop by default.

However, NSImageView doesn't store information about the location of the image in the file system. If you need that information you would need to implement your own view/control.

Rob Keniger