More information:
I copied the download code from this program and created a new program. It is able to download the file (getting an HTTP status code of 200).
So I now think there is something cached in the original program that is causing it to be blocked. If this were a browser, I would clear the caches/cookies/etc. How can I do that with URLSession?
I deleted the CACHES folder under the Library/Containers. I even deleted the entire sandbox under Library/Containers (the program rebuilt it). Still getting the 403 error.
Post
Replies
Boosts
Views
Activity
Sorry about the poorly formatted comment. I guess you can't include code blocks in comments, and I can't find a way to delete my comment, so here it is again, in a more readable format.
Thank you for your speedy reply, but I must still be missing something. I created a simple macOS app and modified the ContenView struct.
struct ContentView: View {
var text: String {
if #available(macOS 12, *) {
return "Hello, world! OSX12"
} else {
return "Hello, world! OSX11"
}
}
var body: some View {
Text(text)
.padding()
}
}
`
But no matter how I set the macOS Deployment Target in the project or deployment target in the target, it always displays Hello, world OSX 12 when I run it.
Thanks
Regarding the "copy_read_only:" message. I was able to reproduce the messages on a MacOS app with the "Hello, world" initial view from a new SwiftUI app. I was able to make the message go away by giving the app read/write access to the user selected and pictures folders in the app sandbox, or by removing the sandbox.