removeItemAtPath - 错误:无法删除,因为您无权访问它

时间:2015-04-02 01:36:17

标签: ios macos file cocoa-touch nsfilemanager

我的代码:

NSFileManager.defaultManager().removeItemAtPath(path, error: nil)

我的日志错误:

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

我已阅读了两个主题,但他们无法解决我的错误。

osx - How to programmatically delete a file with elevated privileges?

Obtaining admin privileges to delete files using rm from a Cocoa app

使用Objective-C或Swift的答案都可以。

0 个答案:

没有答案