• 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: Phill Kelley <email@hidden>
  • Date: Tue, 07 Oct 2003 18:22:20 +1000

At 23:26 -0700 06/10/2003, April Gendill wrote:
>Ok... Why doesn't NSTask work like the terminal?
>According to what I have read you pass arguments to the task as array
>elements. fine.. But why won't it accept ANY argument which requires a
>parameter?
>something like
>
>Regular arguments -l or -a or something go just fine, but when it's
>something like -l someparameter or -a parameter, I get an invalid
>argument.
>How am I able to pass an argument that needs a parameter through NSTask?

>Ok... Why doesn't NSTask work like the terminal?
>According to what I have read you pass arguments to the task as array
>elements. fine.. But why won't it accept ANY argument which requires a
>parameter?
>something like
>
>Regular arguments -l or -a or something go just fine, but when it's
>something like -l someparameter or -a parameter, I get an invalid
>argument.
>How am I able to pass an argument that needs a parameter through NSTask?
>
>April.

Hi April,

Each argument needs to be passed separately. For example:

NSTask* task = [[NSTask alloc] init];

NSMutableArray* taskArguments = [NSMutableArray array];

[taskArguments addObject:@"-l"];
[taskArguments addObject:@"someparameter"];

[task setArguments:taskArguments];
...


Regards, Phill
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSTask
      • From: April Gendill <email@hidden>
References: 
 >NSTask (From: April Gendill <email@hidden>)

  • Prev by Date: Re: different launch methods
  • Next by Date: Re: [OT] serial number validation algorithm?
  • Previous by thread: NSTask
  • Next by thread: Re: NSTask
  • Index(es):
    • Date
    • Thread