While trying to use the NSSavePanel, there is an error at run time.
The Error is:
ERROR: Unable to display save panel: your app has the User Selected File Read entitlement but it needs User Selected File Read/Write to display save panels. Please ensure that your app's target capabilities include the proper entitlements.
The code is:
let targetPath = NSHomeDirectory()
let mySave = NSSavePanel()
mySave.title = "Save a File Here"
mySave.prompt = "Save Me"
mySave.directoryURL = URL(fileURLWithPath: targetPath.appending("/Desktop"))
mySave.canCreateDirectories = true
mySave.showsHiddenFiles = false
mySave.allowedFileTypes = ["adi"]
Note: I did add code for using the NSSavePanel to ensure the program could write directly to a file. That code worked as expected. The the program can write to a file.
Selecting any option will automatically load the page