AppleScript was a solution for me, but I had to add tabs ( \t) for it to work:
NSString* path = ...;
NSString* script = [NSString stringWithFormat:@"tell application \"Finder\"\n\tactivate\n\tmake new Finder window to (POSIX file \"%@\")\nend tell\n", path];
NSAppleScript* openScript = [[NSAppleScript alloc] initWithSource:script];
[openScript executeAndReturnError:nil];
so the result of the script is as follows:
tell application "Finder"
activate
make new Finder window to (POSIX file "/Users/MyUser/someFolder")
end tell
source
share