(1) Hi All, I'm a bit of a newbie to Apple, but have used FreeBSD/Linux so I'm somewhat familiar with it's file systems and access with C, C++, and TclTk. I'm really trying to wrap my head around the "Apple FileManager" but find the documentation difficult without the best of examples. Are there any good books out on Xcode, Apple Foundation usage (FileManager) and the NSFileSystem?, etc? Or how to even read and understand Apple's Developer Documents?
Thanks to Quinn (The Eskimo), for replying on Swift Forum, he suggested I follow up here, and he gave me some good pointers on Docs to read. I believe now the below question is due to attributes of "Sandboxing". Since I knew MacOS was BSD underneath, I'd used a Terminal and created other directories other than just the "recommended". While playing with Xcode, I noticed if I used MacOS, "Command Line" and complile a File enumerator from "let directoryURL = URL(fileURLWithPath: "/Users/me/Documents/MyFolder")" I get it asking do I want to give it permission to view my "MyFolder". If I set up a "MacOS, App, and use the same code it fails and I see no asking permission box come up. **Is there a way to give specific access/Entitlements to folders under /Users/me/folders to the/an Xcode app I'm working on? ** The below "NDUOASV" demo code from Apple is what has led me down this path.... If I drop the folders from Finder into the NDUOASV app, it works.
(2) Does anyone out there have experience with "NavigatingHierarchicalDataUsingOutlineAndSplitViews" in the Apple docs. If so please read the following. I've been playing with it to try and help understand the Apple File System and usage. I've put in a print("debug", url) in the function func addFileSystemObject(_ url: URL, indexPath: IndexPath) { In the code, I've located where they load a default example directory for viewing in their app in their file "OutlineViewController.swift". The code is let appsURLs = FileManager.default.urls(for: .applicationDirectory, in: .localDomainMask) addFileSystemObject(appsURLs[0], indexPath: IndexPath(indexes: [0, 0])) It does as expected. The file URL is " debug file:///Applications/". However when I change the directory such as let docsURLs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) addFileSystemObject(docsURLs[0], indexPath: IndexPath(indexes: [0, 0])) I would of expected it locating my Documents Directory (which is iClouded) under my user directory. Instead it creates a directory... "debug print file:///Users/me/Library/Containers/com.example.apple-samplecode.SourceViewMD7FZBNW84/Data/Documents/" I believe the demo app is sandboxing me correct? But when I drag and drop a folder from my user documents directory into the app from finder it's "debug result is... " debug file:///Users/me/Documents/MyFolder/ "