Post

Replies

Boosts

Views

Activity

Reply to Permission to read a local file
Thanks a lot for the answers, @szymczyk and @eskimo. I got a better understanding of the system and its privileges system. But for some reason I can't give my test-app full privileges. I will tell you in detail what I did: I gave my test-app full access to disk. This was not possible immediately after compiling but after a short time. I found out that when the .XCInstall folder appeared in the Release- or Debug-folder, I was able to add my test-app in the "full access to disk"-list in the system settings. Can I enforce that the .XCInstall-folder will be created? Because the .app-files in there can be executed by my Mac without running Xcode. It seems that these files are portable and could be added to another Mac (by USB-stick for example) and can then be executed (after updating the system-settings...), equally to the .exe-files on Windows. I have to add that I only want to create apps for private use. So I also don't want to buy an Apple Developer Enrollment. And there is the problem with how to force Xcode to export the .app-file that can be executed directly by a Mac when starting the .app in the Finder or desktop. I added these lines of code to my test-app: Get the url:let url = URL(filePath: "/Users/myname/Desktop/Musik/title.mp3") Call the constructor of ACAudioPlayer with the needed arguments: player = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.mp3.rawValue) 3.player.play() In the iPhone simulator this works fine. The mp3 file is played. But as soon as I switch over to my Mac there is this error "The operation couldn’t be completed. (OSStatus error -54.)" which seems to be the permissions error.
Jul ’23