Re: How to receive dragging files into TableView
Re: How to receive dragging files into TableView
- Subject: Re: How to receive dragging files into TableView
- From: Taisuke Sato <email@hidden>
- Date: Thu, 2 Jan 2003 10:12:25 +0900
Hi Daryn,
On 2003.1.2, at 03:52 AM, Daryn wrote:
I think you need to implement tableView:acceptDrop:row:dropOperation:.
Thank you for your reply. I checked online documents after
receiving your email and found a topic for drag & drop onto
NSTableView. I tried to implement
tableView:acceptDrop:row:dropOperation:
in Data Source class as your advice but I couldn't success this issue...
Here is my source of tableView:acceptDrop:row:dropOperation:.
- (BOOL)tableView: (NSTableView *)table
acceptDrop: (id <NSDraggingInfo>)info
row: (int)row
dropOperation: (NSTableViewDropOperation)operation
{
NSPasteboard *pboard = [info draggingPasteboard];
if([pboard hasType:NSFilenamesPboardType]){
NSArray *myfiles = [pboard
propertyListForType:NSFilenamesPboardType]; // we will get an array
int mynumberOfFiles = [files count];
[numberOfFiles:mynumberOfFiles];
[files:myfiles];
}
return YES;
}
I have one TableView, one text field and one text box on my application.
When I drag a file on Finder and drop into the TableView of my
application,
the file goes back to original location with animation. Is this a lack
of
any setup for whole application or just coding mistaken for
tableView:acceptDrop:row:dropOperation:? Would you please give me your
advice?
Regards,
Taisuke
_______________________________________________
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.