• 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
Re: Drag and Drop between two Tableviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag and Drop between two Tableviews


  • Subject: Re: Drag and Drop between two Tableviews
  • From: Wain <email@hidden>
  • Date: Fri, 6 Jan 2006 14:41:35 +0000

Hi Steve,

Is tableView:acceptDrop:row:dropOperation: being called when you drag things over the second tableview?
And what are you using as your delegate?


another example (maybe useful):
http://www.nongnu.org/gstutorial/en/ch13s04.html

Wain

On 6 Jan 2006, at 01:12, Steve Gran wrote:

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


___________________________________________________________ NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
_______________________________________________
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
References: 
 >Drag and Drop between two Tableviews (From: Steve Gran <email@hidden>)

  • Prev by Date: Cocoa versus Carbon networking issue.
  • Next by Date: Re: Internationalization support
  • Previous by thread: Drag and Drop between two Tableviews
  • Next by thread: Re: Drag and Drop between two Tableviews
  • Index(es):
    • Date
    • Thread