Re: NSTableView drop targeting error
Re: NSTableView drop targeting error
- Subject: Re: NSTableView drop targeting error
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 6 Apr 2004 15:42:55 +0200
Le 6 avr. 2004, ` 15:20, Jesse Grosjean a icrit :
When dropping onto an empty table view (at the very top of the view)
I'm getting the console error:
ERROR: Attempt to set dropRow=0, dropOperation=NSTableViewDropOn when
[0 - 0] is valid range of rows.
I've even tried always returning NSDragOperationNone from the table
views validateDrop method, but that doesn't seem to work, so I'm sure
that I'm not setting the invalid drop target. I've also noticed that a
number of other cocoa apps also have this error in the same situation,
but others don't. This error message doesn't seem to cause any damage
(application keeps running), but I'd like to make sure that I'm not
doing anything wrong.
I can get rid of the error message by overriding NSTableView's
- (void)setDropRow:(int)row dropOperation:(NSTableViewDropOperation)op
{
if (row == 0 && op == NSTableViewDropOn && [self numberOfRows] ==
0) return;
[super setDropRow:row dropOperation:op];
}
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
?
_______________________________________________
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.