• 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: validateDrop in NSTableView never called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: validateDrop in NSTableView never called


  • Subject: Re: validateDrop in NSTableView never called
  • From: August Trometer <email@hidden>
  • Date: Sat, 8 Apr 2006 16:18:05 -0400

Without seeing a code sample, I'd bet that you're not implementing this in the right place.

tableView:validateDrop:proposedRow:proposedDropOperation is a data source method meaning that you need to implement it in the object you have set as the table's data source. This could be the NSTableView itself (though that would be weird) or it could be the NSArrayController or some other object.

-- August





On Apr 8, 2006, at 3:39 PM, Tristan Jehan wrote:

I've been struggling with drag-and-drop in an NSTableView for a while now.

I have an NSTableView setup like in the "Bookmarks" example. The data source and delegate of it is a subclass of an NSArrayController where is implemented at least the three methods: tableView:writeRowsWithIndexes:toPasteboard:, tableView:validateDrop:proposedRow:proposedDropOperation:, and tableView: acceptDrop:row:dropOperation:

I register the drag-and-drop in the awakeFromNib function of that NSArrayController with: [tableView registerForDraggedTypes: [NSArray arrayWithObjects: CopiedRowsType, MovedRowsType, nil]]; and that gets passed just fine.

At runtime, tableView:writeRowsWithIndexes:toPasteboard: gets called and returns YES. However tableView:validateDrop:proposedRow:proposedDropOperation: and tableView: acceptDrop:row:dropOperation: never get called and the dragged row goes back to its initial location. What am I possibly doing wrong? Thanks.

Tristan
_______________________________________________
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

_______________________________________________ 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: validateDrop in NSTableView never called
      • From: Tristan Jehan <email@hidden>
References: 
 >validateDrop in NSTableView never called (From: Tristan Jehan <email@hidden>)

  • Prev by Date: validateDrop in NSTableView never called
  • Next by Date: Re: validateDrop in NSTableView never called
  • Previous by thread: validateDrop in NSTableView never called
  • Next by thread: Re: validateDrop in NSTableView never called
  • Index(es):
    • Date
    • Thread