Migrating Application Support to Container using C++

Hello, I am in the process of trying to figure out how to move my save game files from the Application Support Directory to a Container. This is the code I have so far, but I get an error with the first line:

If you look at Apple's docs on sandboxing, you'll see that the design intention is for you to use NSHomeDirectory(), which returns either the root of the sandbox or the user's actual home folder depending on whether or not your app is sandboxed.

I'm puzzled. I just came across this https://devforums.apple.com/message/714742 and see that it's you. And in that thread you suggest that it's all working fine as of two days ago, but yesterday it's not again?

At any rate, as CFM said, don't use CFCopyHomeDirectoryURLForUser; it was a mistake that he included it. (It's a private function.) Use CFURLCreateFromFileSystemRepresentation(getpwuid()) if you don't want to use Obj-C or Obj-C++. Otherwise you can use or create wrapper around NSSearchPathForDirectoriesInDomains / NSHomeDirectory / NSFileManager -URLForDirectory:NSApplicationSupportDirectory ... etc.