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

Re: NSTask


  • Subject: Re: NSTask
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 7 Oct 2003 08:42:10 -0700

On Tuesday, October 7, 2003, at 07:51 AM, April Gendill wrote:

yes I understand that, which is why i have an array, the problem is when I pass an argument like

-arg param

this is what doesn't work.

just an array of arguments works fine

You need to understand what delimitates a argument on the command line.

Typing...
> sometool<space>-arg<space>param
...results in two array entries in argv inside the tool's main routine. In other words it get two entries and has to understand that they are related on its own.

NSTask follows this convention in that you have to pass two separate arguments since the command tool is expecting two separate (granted related) arguments.

One way that may help you think about this... for every element in the array you pass to NSTask consider it to be double quoted on the command line if you where to type it out.

So passing in an array entry of -agr<space>param to NSTask equates with "-agr<space>param" on the command line. While passing in -arg and param as two separate array entries equates with "-arg" "param". The former would not be what the tool was expecting while the later is.

-Shawn
_______________________________________________
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: NSTask (From: April Gendill <email@hidden>)

  • Prev by Date: Re: NSTask
  • Next by Date: Re: mutable keys in NSMutableDictionary
  • Previous by thread: Re: NSTask
  • Next by thread: launching 2 same applications
  • Index(es):
    • Date
    • Thread