• 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: cocoa-dev digest, Vol 2 #1731 - 13 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #1731 - 13 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #1731 - 13 msgs
  • From: Jerry LeVan <email@hidden>
  • Date: Wed, 01 Jan 2003 23:11:48 -0500

Hi,

I have some code that implements dragging a file onto a tableview, the code
Grabs the dragged file's name and uses it to fill the table.

It's located here: http://homepage.mac.com/levanj

--Jerry

>> 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.

  • Prev by Date: Re: NSColor (alpha enabling and setting color in color panel)
  • Next by Date: Re: Cocoa code for publishing a calendar
  • Previous by thread: Re: Unarchiving Individual Windows from a Nib File
  • Next by thread: [basic] retain an NSTextView object and update a window
  • Index(es):
    • Date
    • Thread