• 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
Promised Drag/Thread Conundrum
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Promised Drag/Thread Conundrum


  • Subject: Promised Drag/Thread Conundrum
  • From: Buzz Andersen <email@hidden>
  • Date: Sun, 20 Oct 2002 19:50:54 -0600

All,
I have posted questions about this before and didn't get many responses (perhaps because I didn't explain the problem well enough), but I am just exasperated enough to try again. Basically, I am attempting to facilitate a drag out of an NSTableView that will copy a file to the drop location. There are two aspects of my approach, however, that are making this difficult:

1. I want control over the copy (i.e. I don't want the Finder to take over), so I need to do a promised drag.

2. I want the copy to happen in a separate thread, to facilitate maximum responsiveness and allow the GUI to continue updating.

Normally, of course, the thing to do would be to simply perform the actual copy in the namesOfPromisedFilesDroppedAtDestination: method and return the names of the files copied. However, if I perform the copy in a separate thread, the whole thing happens asynchronously, so I have no way of ensuring that the files are created before I return their names. In this case, the copy is kicked into a separate thread (where it takes God knows how long), and the namesOfPromisedFilesDroppedAtDestination: method returns immediately, causing the Finder to look for the files and complain when it can't find them (it says "CFURLGetFSRef failed").

So, to get down to it, I guess what I'm asking is: does anyone know of a different way I could accomplish the drag while still maintaining control over the actual copy, without resorting to the "promised drag" stuff (since asynchronicity and promised drags don't seem to mix)? Or, alternatively, does anyone know of a good way around the conundrum I'm facing here?

Thanks once again for everyone's help...

--
Buzz Andersen
email: email@hidden
web: http://www.scifihifi.com
_______________________________________________
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: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
  • Next by Date: Re: NSLayoutManager vs BBEdit (Was Re: Carbon vs Cocoa arguments)
  • Previous by thread: Re: cocoa-dev digest, Vol 2 #1410 - 12 msgs
  • Next by thread: Complete Control Over A
  • Index(es):
    • Date
    • Thread