I've started a discussion https://devforums.apple.com/message/1138585 in the old forums, but I can't reply there anymore.
I'm still not satisfied with the answer, because the terminology of file and path choosing API seems off.
When I select a file, I have to traverse a path, and the directories belong to a path. A filename by itself is useless and NSOpenPanel returns the directory and filename, which is a path. So in any case, a path is returned, either if a directory or a filename is chosen.
But my problem is that NSOpenPanel returns a path which I have not selected, thus I think that this is a bug. It might be possible that my example was not understood, so I will re-phrase the example:
I have a directory /usr/local/mongodb-osx-x86_64-3.0.3/bin and there is a link
ln -s /usr/local/mongodb-osx-x86_64-3.0.3 /usr/local/mongodb
Now I select
/usr/local/mongodb/bin/mongod
but NSOpenPanel returns:
/usr/local/mongodb-osx-x86_64-3.0.3/bin/mongod
Please note that I have set [panel setResolvesAliases:NO];
So how can I get the path from NSOpenPanel which I have actually selected (NSPathControl has the same problem)?