After Upgrading to Xcode 7, I tried to re-run my app and I am now getting the following error:
You don’t have permission to save the file “PDF” in the folder “Documents”.
I can't figure out what the problem is, someone pls help. I've already tried clearing derived data and cleaning my project.
I saw this thread, but none of the solutions helped -> Error while build project Xcode says: "you don't have permission"
UPDATED - Here's my code:
var docsDirNew: NSURL!
var currentPath: String!
docsDirNew = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
let unknown = docsDirNew.URLByAppendingPathComponent(dirPath)
currentPath = "\(unknown)"
var error: NSError?
do {
try filemgr.createDirectoryAtPath(currentPath, withIntermediateDirectories: true, attributes: nil)
Scripts.logClass(className, message: "fileOperationsCreateDirectory >> CREATE Directory SUCCESS")
}
catch let error1 as NSError {
error = error1
Scripts.logClass(className, message: "fileOperationsCreateDirectory >> CREATE Directory FAILED >> \(error!.localizedDescription)")
}