• 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
dragging to desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dragging to desktop


  • Subject: dragging to desktop
  • From: Torsten Curdt <email@hidden>
  • Date: Thu, 01 Dec 2011 16:19:22 +0100

I have a NSImageView and the user should be able to drag from it onto
the Finder which will then create a file. While I found this in the
archives

  http://www.cocoabuilder.com/archive/cocoa/43556-drag-and-drop-onto-the-desktop.html

the docs and some other posts on the internetz suggest to use a "HFS
Promise Drag" instead

  http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html#//apple_ref/doc/uid/20001288-CEGJFDFG
  http://speirs.org/blog/2009/12/5/hfs-promise-drags-from-ikimagebrowserview.html

So on a mouse down I am now calling

    [self dragPromisedFilesOfTypes:[NSArray arrayWithObject:@"pdf"]
                          fromRect:imageLocation
                            source:self
                         slideBack:YES
                             event:theEvent];

which initiates the drag session. When I drop it onto the Finder
namesOfPromisedFilesDroppedAtDestination: gets called.

Now while I could create the file in
namesOfPromisedFilesDroppedAtDestination: I am not sure whether that
is the correct place. The docs state "After a drag operation is
dropped, the dragging destination receives a performDragOperation:
message." but I don't see that method getting called at all.

Where is the correct place to create the files for the drop destination?
And will this also work when sandbox'ed?

cheers,
Torsten
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: dragging to desktop
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: "Unusual" interface, usage of 3d party GUI framework and Mac App Store
  • Next by Date: Re: dragging to desktop
  • Previous by thread: Re: "Unusual" interface, usage of 3d party GUI framework and Mac App Store
  • Next by thread: Re: dragging to desktop
  • Index(es):
    • Date
    • Thread