title: Getting desktop path for current user on macOS
body: <p>I use</p>
  
  <pre><code>NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES );
  NSString* theDesktopPath = [paths objectAtIndex:0];
  </code></pre>
  
  <p>It works well. But when I launch the application with sudo it gives the root's desktop path. Is there any way to return current user's desktop always (even if the app is started with sudo)?</p>