NSLibraryDirectory changed in macOS 11

I have relied on the call :

NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);

to get to the ~/Library folder which I then present to the user using NSOpenPanel

Now suddenly, on macOS 11, the return path is to the library folder within the CONTAINER of the application.

I don't think this is correct. It suddenly changes the behaviour.

Trying to build the path starting from NSHomeDirectory() also does not work (again container).

If Apple does not want to fix this, what could be a work-around?

Thanks,

Alco Blom
This how it has always worked. If your app is sandboxed, all you get are directories in the container. Turn off sandboxing to get the equivalent locations in the user home directory.
No. I am sorry to say to Etresoft, this has NOT been always like this. With the above call I have been able UNTIL macOS 11 to present the user (for selection) the bookmark files of browsers in the ~/Library folder, but this is now broken in macOS 11. My app has been sandboxed for several years now (necessary for Mac App Store).

Hi, currently, I'm facing the same problem as above. On MACOS 11.5, the path is "/Users/[user]/Documents" @alcoblom Did you have any solution for this?

At some point (I don't remember when), it started to act again like before. Perhaps Apple put something in only for my app URL Manager Pro... I don't know. I never got a reply or response from Apple.

NSLibraryDirectory changed in macOS 11
 
 
Q