• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drag and Drop between two Tableviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Drag and Drop between two Tableviews
      • From: Corbin Dunn <email@hidden>
    • Re: Drag and Drop between two Tableviews
      • From: Ryan Britton <email@hidden>
    • Re: Drag and Drop between two Tableviews
      • From: Wain <email@hidden>
  • Prev by Date: Re: Bindings Problem
  • Next by Date: Fwd: Internationalization support
  • Previous by thread: Re: How to create Daemon for Mac 10.
  • Next by thread: Re: Drag and Drop between two Tableviews
  • Index(es):
    • Date
    • Thread