Drag and drop table cell from one table to another

Hi there,

Im New to ASOC and i would need some help towards the right direction

In my OSX APP i have two separate object based tables (A+B) with cocoa bindings for each column and an arrayController for each. Both work perfect.

I’d like to drag and drop a table Cell from table A to B → the cell should be ADDED to the row in table B but NOT deleted from A.

So i have two questions:

1.) How do i enable DRAG/DROP behaviour for my tables in ASOC? I found a lot of examples in pure ObjC but it’s still tricky for me to translate that into ASOC language

2.) How can i add the above mentioned behaviour?

I don’t want someone to write down the complete Code for me - i want to learn with the right amount of help.

Pat

What you want to do is complex, regardless of the language. If you search around here, you will find example code for dragging a row within a table (I assume you mean row rather than cell – otherwise it’s even more complicated). I suggest you get that part working first, before moving to drag and drop between separate tables.

Thank you Stanley.

I’m getting closer and managed drag & drop of rows from one table to another.

Now I’m stocked at identifying the cell the user clicked on. Any help on that? (ASObjC)

You will probably have to do something like subclass the table view, override -mouseDown: to get the point of the mouse click, and then use -columnAtPoint: and -rowAtPoint: to calculate the cell.

Sounds logical. I’ll try that and give feedback