Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
If I had two multi-column tables of more-or-less the same type, such as two different documents, I would consider two possibilities.

First, if the columns will always be the same, you can match the cell values by identifier. Otherwise (if the user can add or remove columns or edit their headers), I would match the cell values by the header title, only putting in values for header titles that match. Either of these techniques would be appropriate for other types of transfers.

The drag source table must write a type to the pasteboard that the receiving table recognizes (included in the -registerForDraggedTypes: method argument). The source table should fill a dictionary with cell values keyed to either their column identifier or header title, filling an array with these dictionaries for each row dragged. It will write this to the pasteboard using -setPropertyList:forType:, which the destination table will read from the pasteboard with -propertyListForType: and add or insert rows, using the keys to match cell values to the appropriate columns.

You should select a type name for this data that will most likely not be recognized by any other app that might see the drag pass its window ("Fernando'sApp'sTableDataSpecialType" or something like that), though it is probably good practice to write other types to the pasteboard, such as text, so that the user might be able to drop the data onto some other app.
 
If I had two multi-column tables of more-or-less the same type, such as two different documents, I would consider two possibilities.

First, if the columns will always be the same, you can match the cell values by identifier. Otherwise (if the user can add or remove columns or edit their headers), I would match the cell values by the header title, only putting in values for header titles that match. Either of these techniques would be appropriate for other types of transfers.

The drag source table must write a type to the pasteboard that the receiving table recognizes (included in the -registerForDraggedTypes: method argument). The source table should fill a dictionary with cell values keyed to either their column identifier or header title, filling an array with these dictionaries for each row dragged. It will write this to the pasteboard using -setPropertyList:forType:, which the destination table will read from the pasteboard with -propertyListForType: and add or insert rows, using the keys to match cell values to the appropriate columns.

You should select a type name for this data that will most likely not be recognized by any other app that might see the drag pass its window ("Fernando'sApp'sTableDataSpecialType" or something like that), though it is probably good practice to write other types to the pasteboard, such as text, so that the user might be able to drop the data onto some other app.

Thanks! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.