Welcome to the world of wonders that is the Launch Services database (-:
This aspect of NSWorkspace
is a thin wrapper around Launch Services. Launch Services has a database of known apps and one of those apps is the default, the version that gets launched when the user double clicks a document owned by the app. AFAIK, and your tests seems to confirm that, Launch Services doesn’t have any smarts to specifically exclude apps within an Xcode archive.
Now, you could argue that it should (and I’d probably agree with you on that front :-). Feel free to put your argument in a bug report about this. Please post your bug number, just for the record.
As to what you can do about this, it kinda depend. This isn’t an issue on most user machines because they don’t have an Xcode archive containing your app. So this problem is only affecting you (and maybe other developers on your team). The way I usually get around this is as follows:
-
In the Finder, select a doc that’s opened by my app and choose File > Get Info.
-
In the “Open with” pane, click on the popup and select a specific app to be the default.
-
Click Change All.
Does that work for you? If not, please elaborate on the specific circumstances you’re dealing with.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"