My code:
NSFileManager.defaultManager().removeItemAtPath(path, error: nil)
My log error:
NSUnderlyingError=0x618000255900 "The operation couldn’t be completed. Permission denied"})
“SecureDelete Lite” couldn’t be removed because you don’t have permission to access it
I have read two topics but they don't resolve my bug.
osx - How to programmatically delete a file with elevated privileges?
Obtaining admin privileges to delete files using rm from a Cocoa app
Answers with Objective-C or Swift are OK.