Drag and Drop between two Tableviews
Drag and Drop between two Tableviews
- Subject: Drag and Drop between two Tableviews
- From: Steve Gran <email@hidden>
- Date: Thu, 5 Jan 2006 17:12:00 -0800
As always I preface with the fact that I'm just learning how to
program so please be gentle. I was looking at those good examples on
mmalc's Cocoa Bindings Examples and Hints page. In particular, I'm
trying to use drag and drop from one tableview to another tableview
(controlled by a different array controller of course). I first
tried to implement the three drag and drop methods...
- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows
toPasteboard:(NSPasteboard*)pboard;
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id
<NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:
(NSTableViewDropOperation)op;
- (BOOL)tableView:(NSTableView*)tv acceptDrop:(id <NSDraggingInfo>)
info row:(int)row dropOperation:(NSTableViewDropOperation)op;
...in both of my array controllers. But then I got a bit lost. The
drag part works but I can't seem to get the other tableview to accept
the drop. In mmalc's example (it's the "Bookmarks" one) he has what
he calls a utility method...
-(void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet *)indexSet
toIndex:(unsigned)index;
...and I wonder if that's my problem and that I need something like
this (but I just can't figure out what) for the "insert" role in the
new array.
If someone can suggest the right way to do it or point me to a snipet
of code that shows how to get drag and drop between two tableviews.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden