Moves the specified URLs to the trash in the same manner as the Finder.
- macOS 10.6+
An array of
NSURLobjects representing the files to move to the trash. This parameter must not be
The completion handler block object to call when the operation completes. You may specify
nilfor this parameter. If this parameter is not
nil, you must call the
recyclemethod from a block running on an active dispatch queue; your completion handler block is subsequently executed on the same dispatch queue.
URLs: completion Handler:
The block takes two arguments:
A dictionary parameter whose keys and values are
NSURLobjects. Each key is a URL from the
URLsparameter. The value of each key is a URL representing the location of the file in the trash. If this method could not move a file to the trash, the corresponding URL is not included in the dictionary.
If the operation succeeded for every file, this parameter is
nil. If the operation failed for one or more files, the parameter contains an error object describing the overall result of the operation in a manner suitable for presentation to the user.
This method may cause a progress indicator, or other user interface element, to be shown by the Finder.
In OS X v10.6, this method requires that the main run loop be run in a common mode to facilitate the display of any user interface elements. It is safe to call this method from any thread of your app.