I found an issue with XCode 14.3 on iOS when the build configuration (in schema) or archive are in Release.
No issues on XCode 14.2 or Debug.
Look the example below.
fileProfile and folderDevice are with "try?". Both are nil because both not exist.
the do/catch doesn't throws an exception instead a thread exception into the AppDelegate appears.
let filePathProfile = Const.LOCAL_PATH_PROFILE // is /var/..../file.jpg
let filePathDevice = Const.LOCAL_PATH_DEVICES_ROOT // is /var/..../folder
let fileProfile = try? File(path: filePathProfile)
let folderDevice = try? Folder(path: filePathDevice)
do {
try fileProfile?.delete()
try folderDevice?.delete()
}
catch {
debugPrint("\(error.localizedDescription)")
}
The issue not appear and the exception LocationErrorReason.emptyFilePath is correctly thrown if:
try? is replaced with try
?.delete() is replaced with .delete()
the two "let..." rows are moved into the do/catch
let filePathProfile = Const.LOCAL_PATH_PROFILE // is /var/..../file.jpg
let filePathDevice = Const.LOCAL_PATH_DEVICES_ROOT // is /var/..../folder
do {
let fileProfile = try File(path: filePathProfile)
let folderDevice = try Folder(path: filePathDevice)
try fileProfile.delete()
try folderDevice.delete()
}
catch {
debugPrint("\(error.localizedDescription)")
}
I don't know if the issue is caused by File, Folder or both.
I found an issue with XCode 14.3 on iOS when the build configuration (in schema) or archive are in Release. No issues on XCode 14.2 or Debug.
Look the example below.
fileProfile and folderDevice are with "try?". Both are nil because both not exist. the do/catch doesn't throws an exception instead a thread exception into the AppDelegate appears.
The issue not appear and the exception LocationErrorReason.emptyFilePath is correctly thrown if:
I don't know if the issue is caused by File, Folder or both.