0

I use NSWorkspace sharedWorkspace method recycleURLs: completionHandler: to delete files.

If the user does not have the correct permissions e.g. to delete from /Applications this produces an error. Finder prompts the user for the sudo password then proceeds to delete files.

While it is easy enough to detect the error, and prompt the user, I can't figure out how I could then programmatically force deletion.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Milliways
  • 1,265
  • 1
  • 12
  • 26
  • possible duplicate of [Obtaining admin privileges to delete files using rm from a Cocoa app](http://stackoverflow.com/questions/3588779/obtaining-admin-privileges-to-delete-files-using-rm-from-a-cocoa-app) – Chuck Apr 03 '14 at 00:57
  • The "answer" is several years old, and refers to method that is deprecated in 10.7 – Milliways Apr 03 '14 at 05:17

0 Answers0