The file “Desktop” couldn’t be opened.

hey everyone.!!

In one of my macOS projects I am trying to fetch the files and folders available on "Desktop" and "Document" folder and trying to showing it on collection view inside the my project, but when I try to fetch the files and folder of desktop and document, I am not able to fetch it. But if i try it by setting the entitlements False, I am able to fetch it. If any have face the similar issue, or have an alternative it please suggest.

NOTE:- I have tried implementing it using NSOpenPanel and it works, but it lowers the user experience.

The file “Desktop” couldn’t be opened.
 
 
Q