• 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
Problem with arguments of an NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with arguments of an NSTask


  • Subject: Problem with arguments of an NSTask
  • From: Arthur VIGAN <email@hidden>
  • Date: Tue, 29 Oct 2002 13:02:31 +0100

Hi,

I would like to use arguments to launch a command line application using an NSTask (the SETI@home client), but I get some troubles. Everything works just fine when I laucnh the task without any argument, but the following code doesn't work and I don't see where the mistake is:

NSArray *arguments = [NSArray arrayWithObject:@"-nice 19"];
NSTask *setiTask = [[NSTask alloc] init];

[setiTask setArguments:arguments];

//there is some other stuff here, but this is not the problem

NSLog(@" --> Running SETI...");
[setiTask launch];

The code is good, but when I launch my application, I get the following message on the console:

bad arg: -nice 19
options:
-version show version info
-login log in
-countries show list of country codes
-nice N set priority to N
...

so "-nice 19" seems to be a bad argument whereas the options indicates that the syntax is good. Where is the problem? Does it come from my code?

Thanks in advance,

Arthur
_______________________________________________
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: Problem with arguments of an NSTask
      • From: Chris Ridd <email@hidden>
    • Re: Problem with arguments of an NSTask
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Problem with arguments of an NSTask
  • Previous by thread: Re: prototyping an interface -> dimming
  • Next by thread: Re: Problem with arguments of an NSTask
  • Index(es):
    • Date
    • Thread