Re: One problem solved, another cropped up
Re: One problem solved, another cropped up
- Subject: Re: One problem solved, another cropped up
- From: Larry Fransson <email@hidden>
- Date: Fri, 30 Jul 2004 01:46:12 -0700
On Jul 29, 2004, at 22:55, Eric Albert wrote:
On Jul 29, 2004, at 1:50 PM, David "Pita" Kopp wrote:
Anyway, next (and hopefully last) problem is that apparently the OS
is passing some parameters to the application when it's run via
double-clicking the .app package. Any ideas what these are?
I think you're talking about the -psn_* argument that gets passed to
double-clicked applications.
Try logging the output of [[NSProcessInfo processInfo] arguments].
Those are probably the "arguments" you're talking about. In my case (I
was messing around with command line arguments the other day just for
my own edification), I get the -psn_ argument as well as the absolute
path to the executable inside the application bundle if I launch with a
double-click or by using 'open' on the command line. If I actually cd
inside the bundle, though, and launch the executable from the command
line, I get just the executable path logged as an argument.
If you want to get arguments from the command line, you can get them
from user defaults if you know which keys will be used. Read about
NSUserDefaults and NSArgumentDomain. Otherwise, NSProcessInfo is
probably the only way, and you'll just have to ignore the first
argument.
Larry Fransson
Seattle, WA
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.