Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Task create failed error for NSTask



Fei,

>>>>>> Fei Li (FL) wrote at Thu, 15 Nov 2001 13:25:00 -0700:
FL> I tried to launch a application named "abc.app" use NSTask, I write code
FL> as follows:
FL> NSArray * args = [[NSArray alloc] initWithObjects:@"2", nil];
FL> [NSTask launchedTaskWithLaunchPath:@"/Users/feil/Desktop/abc.app"
FL> arguments:args];
FL>
FL> I always get error message:Task create for path abc.app failed.
FL>
FL> I think maybe I should change current directory for the NSTask...

Nope. You should give NSTask the executable path, though. The .app is just a
wrapper folder; the actual executable is hidden inside.
@"/Users/feil/Desktop/abc.app/Contents/MacOS/abc" should help.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Task create failed error for NSTask (From: Fei Li <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.