• 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: How to receive dragging files into TableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: How to receive dragging files into TableView (From: Daryn <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: NSColor (alpha enabling and setting color in color panel)
  • Previous by thread: Re: How to receive dragging files into TableView
  • Next by thread: Projects fail to build with space in project name
  • Index(es):
    • Date
    • Thread