Hello everyone, I am new to swift development and I am currently facing a "bug".
I am building, an app on my Mac mini. It's working fine on my machine but when exporting the executable on a MacBook Air, one of my feature does not work anymore.
I should be able to drag and drop a PDF which should be copy to my App document folder. But for some reason it won't work.
I should add that :
- The app is sandboxed
- I tried to build the app on the MacBook Air and it does not work either.
- I gave all the permission to the app in the MacBook Air parameter menu.
- I have another drag and drop functionality with read a csv file, and it works.
With Xcode, the error message was about : file not found (after being read and recognized on my log)
I hope someone would have some ideas
Thank you in advance
PS: I'm French, sorry for my English
Thanks.
The weird thing about this is that you read the source file twice:
- First you read it into
tempData
to check the prefix. - Then the copy engine reads the file so it can copy it.
The error you posted indicates that it’s the copy engine that’s failing; note how the error includes NSUserStringVariant
with a value of Copy
. So, either:
- I’ve misunderstood your code.
- The first read works but the second read, the one done by the copy engine, fails. That would be really strange.
- This is nothing to do with the source file.
To rule out the first possibility, step through the copy and see which line actually throws the error.
To rule out the third possibility, step through the code to the point where it’s constructed destinationURL
and then check that the path (except for the last item) exists.
In your example, the output file is:
/Users/
jean-philippegreaux/
Library/
Containers/
jgreaux.gestion-de-comptes/
Data/
Documents/
2025/
7/
justificatif_88.pdf
I suspect that 2025
or 7
is missing, and hence this error.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"