1,458 questions
0 votes
1 answer
66 views
macOS crash with NSFilePromiseProvider
I am trying to use NSFilePromiseProvider to ‘copy’ a file to the macOS pasteboard, but it always crashes. I have a macOS project that has a text file added to the bundle, and I load the file from the ...
0 votes
0 answers
26 views
How to create a folder in the system documents
I want to create a folder in the system's Documents folder like the application CASRER, but it fails。 public extension URL { static var userHome : URL { URL(fileURLWithPath: userHomePath,...
0 votes
1 answer
56 views
Supporting Custom Files with "/" Characters in Swift
My app has a custom file type, and I'm trying to update my code so that when I export or import a file that has a "/" character in the name. Currently the app just fails to export a file ...
0 votes
1 answer
49 views
Not sure why Swift's fileExists fails on checking existence of a file which I can see in the directory
Part of my app creates files, and then a timer batches them. My problem is that using the fileExists method my app insists that the searched for app does not exist. I see the files in the Files app, ...
1 vote
1 answer
135 views
Swift FileManager.default.copyItem(at: URL, to: URL) folder permission error
I'm writing a small Mac OS X Desktop application that copies a random sampling of files from a source folder to a destination folder, see Select-Random-Files. The code that's giving me the most ...
0 votes
1 answer
244 views
swiftui photopicker video is not accessible after rerunning the application
I'm trying to pick a video with photo picker this way: @State var selectedItem: PhotosPickerItem? = nil @State var showPhotoPicker = false With those 2 states i'm showing the picker: ....
3 votes
0 answers
300 views
When .fileImporter is presented the Xcode console shows: "Unknown client: App Name"
I am writing my first SwiftUI app that uses the FileManager (via .fileImporter) to read data from a saved text (.csv) file. Although everything seems to be working OK, the Xcode console displays the ...
2 votes
1 answer
313 views
Zip files of a Directory without any root folder
I want to zip files inside a folder in my iOS application written in the Swift language. I am using ZipFoundation CocoaPod of version 0.9.5. let fileManager = FileManager.default guard let sourceURL ...
1 vote
0 answers
48 views
Downloading from iCloud, files truncated, fine from other sources
I'm using this code which is a mildly doctored version of an online tutorial. I understand the parts, but when I run it, the downloads happen, I get an error-free completion message. But the resulting ...
0 votes
1 answer
291 views
iOS: how to determine if a file is a bundle resource (included in IPA)
I'm building a framework, and need to differentiate between a file that is a bundle resource (included in the App Store IPA / static file defined at development time) and a file that the app creates (...
0 votes
3 answers
251 views
When we try to export CapturedRoom getting cannotCreateNode(path: "/9EE71ED0F8D6415496A7B9F0C3671DB0321") in
We are using the RoomPlan API to capture data, which is stored in the 'CapturedRoom' variable in our code (referred to as 'finalResult'). We then attempt to save a USDZ file in the file manager. ...
0 votes
2 answers
154 views
How to create model in Swift?
I am a beginner in the Swift language. I have multiple arrays in one view controller from which I am loading data in the tableview. My code is: let filemanager = FileManager.default var ...
0 votes
0 answers
122 views
What does SearchPathDomainMask mean in Swift?
In swift, we use Filemanager.default.url(for:in:) to get user directories or system directories. And we pass arguments typed SearchPathDirectory and SearchPathDomainMask to specify what urls we need. ...
1 vote
0 answers
62 views
How to create a temporary file container, file system, or custom file stream for intercepting clipboard access to temporary files on macOS?
I'm developing a cross-platform clipboard sharing software and currently working on implementing file copying functionality. On Windows, I can achieve file copy by creating an IDataObject and IStream, ...
0 votes
1 answer
233 views
I cannot access a file I have just saved to my documents directory
Here is my saving and retrieving code: func retrieveSong(songId: String) -> URL? { guard let pathComponent = cache[songId] else { return nil } if let ...