• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retrieving application name during runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Retrieving application name during runtime (From: Peter <email@hidden>)

  • Prev by Date: Re: [OT] Objective-C history
  • Next by Date: Re: NSObjectController - > getting it's keys
  • Previous by thread: Re: Retrieving application name during runtime
  • Next by thread: NSLayoutManager's replaceTextStorage - slows down the text view?
  • Index(es):
    • Date
    • Thread