问题
I was writing an app in ios 13 and saving my own filetype to the apps own directory folder. I could see this in the Files app, with my apps name and icon.
I have updated my ipad to ios 13.1 and cannot save or open any files. If I open the Files app, my apps directory doesn't even exist. Why would this have changed? I have tried uninstalling the app, and reinstalling it. I have checked my permissions were as before. It is like the main app directory is not being created, therefore any attempts to write to it do not succeed.
I am using this method to get the directory and save:
let DocumentDirURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
let url = DocumentDirURL.appendingPathComponent(name).appendingPathExtension(fileExt)
do {
try jsonString!.write(to: url, atomically: true, encoding: String.Encoding.utf8)
print(url.path)
}
I have checked my permissions in the Info.plist file and the 'supports opening documents' and the 'itunes file sharing' are both turned on, along with my UTI File type info.
Does anybody know of any changes that may have caused this to act this way? Do I manually need to create the documents folder for my files now?
来源:https://stackoverflow.com/questions/58173265/ios-13-1-cannot-save-file-to-app-directory