I am seeing the same issue with my own code.
Curiously, if the aspect ratio of the image in the button is taller than it is wide then it works normally.
Post
Replies
Boosts
Views
Activity
I have upgraded to Xcode 14.1 RC 2 and this problem has gone away. Feel free to close this.
The system errno is set to -10006. Creating an Errno object with this code gives the following description:
The operation couldn’t be completed. (POSIX error 10006 - Unknown error: 10006)
The same code shows up with the higher level APIs.
This is what I tried:
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
guard let folderUrl = urls.first else {return}
let startAccessing = folderUrl.startAccessingSecurityScopedResource()
defer { if startAccessing {folderUrl.stopAccessingSecurityScopedResource()}}
var error : NSError? = nil
NSFileCoordinator().coordinate(readingItemAt: folderUrl, error: &error) { (url) in
let rep = (url as NSURL).fileSystemRepresentation
guard let dir = opendir(rep) else {return}
defer { closedir(dir) }
while let ent = readdir(dir) {
print(String(cString: &ent.pointee.d_name.0))
}
}
}
No difference. This works for the folders that worked with the higher level APIs (other SMB servers, iCloud, local files) but the while loop never starts with my DiskStation. It does, however, get past the opendir line with what appears to be a valid handle.
Oh, and no, I wouldn't use this as an actual solution either.
Thanks.
Hi, thanks for getting back to me.
Bug report filed here - https://feedbackassistant.apple.com/feedback/8902970, number FB8902970.
I have tried passing nil to includingPropertiesForKeys, in fact that's how I had it initially before, as a guess, I tried narrowing the information I was asking for.
I am unclear as to how to use lower level APIs for accessing the file system on iOS. I would have thought that I'd be prevented from doing this by the app's sandbox. (Unfortunately, Googling this reveals that Google is keen to suggest that MacOS and iOS are the same thing)
Some updates. I have tried this with a share from my Mac and my Windows PC and it works, it's only not working with my Synology DiskStation.
I have full access to this, I can browse and do whatever I like using the Files app. I can open and work with files on it within my app's code, all I can't do is get FileManager to list the contents of a user selected folder.