Re: validateDrop in NSTableView never called
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