Re: Retrieving application name during runtime
Re: Retrieving application name during runtime
- Subject: Re: Retrieving application name during runtime
- From: Sherm Pendley <email@hidden>
- Date: Fri, 10 Dec 2004 22:45:02 -0500
On Dec 10, 2004, at 7:56 AM, Peter wrote:
1) Is there a method to retrieve application name of the running
program itself ?
NSProcessInfo *pi = [NSProcessInfo processInfo];
NSString *appName = [pi processName];
2) Is it possible to get the path of the executable via Cocoa ?
( I know of one possiblity by getting via main(argc, argv) -->
argv[0] by C)
id exePath = [[pi arguments] objectAtIndex: 0];
3) Is it possible to retrieve command line arguments via Cocoa ?
NSArray *args = [pi arguments];
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden