• 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: cocoa and argv
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa and argv


  • Subject: Re: cocoa and argv
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 15 Aug 2002 14:56:30 +0200

On Thursday, August 15, 2002, at 01:13 , Georg Tuparev wrote:

I think you can access command-line arguments using NSUserDefaults NSArgumentDomain... from the NSUserDefaults documentation:


Too complicated.

Matter of factly, in case for the particular tool args of pattern "-Name value" are sufficient, exploiting NSUserDefaults seems to me to be the most plain and most handy solution. No domains needed, just access the user defaults with the appropriate name. The fact that the values can be also stored into the defaults database is just an added benefit one might and need not use.

NSArry *myArgs = [[NSProcessInfo processInfo] arguments];

will return you the list of arguments as you are used form main(argc,argv)
...

whilst of course no arguing that this is the most flexible solution.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: cocoa and argv (From: Georg Tuparev <email@hidden>)

  • Prev by Date: Re: Classes in bundles
  • Next by Date: Re: Getting classes from bundles in an array
  • Previous by thread: Re: cocoa and argv
  • Next by thread: Re: cocoa and argv
  • Index(es):
    • Date
    • Thread