Error Domain=NSCocoaErrorDomain Code=257 "The file “ReceiptScans” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///Users//Documents/ReceiptScans, NSFilePath=/Users//Documents/ReceiptScans, NSUnderlyingError=0x60000178e280 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
I turned off sandboxing to make this work in Big Sur with Xcode 13.1 beta, but when I upgraded to Monterey and Xcode 13.1 I started getting the error again.
let files: [URL] = try FileManager.default.contentsOfDirectory(at: path, includingPropertiesForKeys: nil, options: [FileManager.DirectoryEnumerationOptions.skipsHiddenFiles])
I checked and sandboxing is still turned off. I cleaned the build directory and recompiled. Can't make it work. Have the permissions been changed? Have some API's been changed?
Because sandboxing is turned off I don't think I should have to use any special entitlements.