Re: Drag and stupid Drop in NSTableView
Re: Drag and stupid Drop in NSTableView
- Subject: Re: Drag and stupid Drop in NSTableView
- From: Mark Stockwell <email@hidden>
- Date: Sun, 30 May 2004 01:22:28 -0500
Well, it took a while, but I finally got it. For those following along,
the keys to success were:
-Subclassed my NSArrayController so I could put my delegate methods in
it.
-Every time I tried to control drag from my tableview to my controller
in IB, the info window kept showing me Target/Actions instead of
Outlets. I'm embarrassed to tell you how long it took me to figure out
all I had to do was click on the Outlets tab. Once I figured that
little gem out, it was easy to make my controller the tableview's
delegate and dataSource. That made my delegate methods validatedrop,
writerows, etc... work.
-For the longest time I couldn't seem to get any objects from the paste
board. Then I got really desperate and read the documentation, which
lead me to the important fact that you have to "declareTypes" before
writing new data into the pasteboard.
-I borrowed some code from Apple's DNDArrayController example in which
they copy the rows array to the pasteboard and convert that to row
indexes to be moved. Much easier than copying data (as long as you are
only dragging and dropping locally).
And the rest is just details.
Thanks for the help.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.