Hi Quincey,
I was hoping there was some sort of system level object to work with, or some kind of suite of methods in Bundle or FileManager.
but I was able to cobble something together that I think avoids most "hard coding" traps... But I am now mystified by something.
first let's go over what I wound up with:
let newPath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("Application Support").appendingPathComponent("com." + Bundle.main.bundleIdentifier!).appendingPathComponent("shelf")
I'll unpack that.
so I ask the FileManager for the current user's home directory,
then I append to that : "Application Support",
then I append to that : "com." + the Bundle's identifier. // if I don't add the com, for some reason it's just not included. maybe a malformed bundleID, maybe Apple changed the way they form it. IDK for certain,
then I append : "shelf" // shelf for my app's shelf system.
this gives me something like:
newPath URL "file:///Users/eblu/Application%20Support/com.bkTools.manipDsgnr/shelf/section" // this was copied directly from the debugger. I am making a new section here, and that's why "section" is at the end there.
anyway. here's the problem.
there's no sandboxing, we are in debug mode, but I can't find the files I am creating. There's a container entry for the app (~/Library/containers) but there's NO Application Support folder for the app. And here's the eerie part of the whole thing: the files exist Somewhere. I had a completely fleshed out system before I needed to move to Application support, and when i did that, I just applied the URL change to the whole system... so I'm loading information from SOMEWHERE, I just don't know where.
I've looked through the ~Library/Developer folder structure, and in the App's Package Contents... nothing.
any ideas?