A little trick

I had a problem that my app did not work outside Xcode (had to include the metalkit.framework

I found a simple trick to get my NSLog outputs and locate the issue:

NSURL *downloadsDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSDownloadsDirectory inDomains:NSUserDomainMask] firstObject];

NSURL *fileURL = [downloadsDirectory URLByAppendingPathComponent:@"Log.txt"];

NSString *filePath = [fileURL path];
    
    // Redirect stderr to the file
   freopen([filePath fileSystemRepresentation], "a+", stderr);

Now you get debug info in your Download folder!

A little trick
 
 
Q