Problem with arguments of an NSTask
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.