• 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: Ken Ferry <email@hidden>
  • Date: Fri, 10 Dec 2004 21:56:34 -0500

On Fri, 10 Dec 2004 20:56:12 +0800, Peter <email@hidden> wrote:
> 3) Is it possible to retrieve command line arguments via Cocoa ?

Arguments of the form "-MyKey MyValue" are set as defaults in the
running app [1].  For example, if the app is started like this,

myapp -MyKey MyValue

then

[[NSUserDefaults standardUserDefaults] objectForKey:@"MyKey"]

retrieves @"MyValue".

I don't know if there's a way to get command line arguments that
aren't of that form.

-Ken

[1]: Documented at
<http://developer.apple.com/documentation/Cocoa/Conceptual/UserDefaults/Concepts/DefaultsDomains.html#//apple_ref/doc/uid/20000718/96930>
 _______________________________________________
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: Retrieving application name during runtime
  • Next by Date: How to get NSOpenPanel on the right level/layer?
  • Previous by thread: Re: Retrieving application name during runtime
  • Next by thread: Re: Retrieving application name during runtime
  • Index(es):
    • Date
    • Thread