Re: NSTableView drop targeting error
Re: NSTableView drop targeting error
- Subject: Re: NSTableView drop targeting error
- From: "Louis C. Sacha" <email@hidden>
- Date: Tue, 6 Apr 2004 14:06:46 -0700
Hello...
Have you tried just retargetting the drop in the drop validation
method, as mentioned in the documentation for the NSTableDataSource
protocol method
tableView:validateDrop:proposedRow:proposedDropOperation:?
/* typed in mail, untested, etc... */
- (NSDragOperation)tableView:(NSTableView *)tableView
validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
proposedDropOperation:(NSTableViewDropOperation)operation
{
if ((row==0)&&(operation==NSTableViewDropOn))
{
[tableView setDropRow:0 dropOperation:NSTableViewDropAbove];
}
/* ... do any other validation here ... */
return NSDragOperationEvery; /* or whatever drag operation
type is appropriate */
}
Hope that helps,
Louis
A NSTableViewDropOn on row 0 on an empty NSTableView is strange.
What kind of value are you returning in:
(NSDragOperation)tableView:(NSTableView *)tableView
validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
proposedDropOperation:(NSTableViewDropOperation)operation
I still see the error message even if I always return
- (NSDragOperation)tableView:(NSTableView *)tableView
validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
proposedDropOperation:(NSTableViewDropOperation)operation {
return NSDragOperationNone;
}
from the validateDrop method. This seems to only effect NSTableView,
I've got a NSOutlineView that's using the same model and is setup
almost exactly the same, but it doesn't print this error.
Jesse
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.