Instance Method

trashItemAtURL:resultingItemURL:error:

Moves an item to the trash.

Declaration

- (BOOL)trashItemAtURL:(NSURL *)url resultingItemURL:(NSURL * _Nullable *)outResultingURL error:(NSError * _Nullable *)error;

Parameters

url

The item to move to the trash.

outResultingURL

On input, a pointer to a URL object. On output, this pointer is set to the item’s location in the trash. The actual name of the item may be changed when moving it to the trash, so use this URL to access it. You may specify nil for this parameter if you do not want the information.

error

On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Return Value

YES if the item at url was successfully moved to the trash, or NO if the item was not moved to the trash.

Discussion

See Also

Related Symbols

- removeItemAtPath:error:

Removes the file or directory at the specified path.

- removeItemAtURL:error:

Removes the file or directory at the specified URL.