Mailing Lists: Apple Mailing Lists

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

Launching Application with arguments



Hello the list,

I read the following thread and I extracted some interesting things :

---------
On Thursday, November 15, 2001, at 12:25 PM, Fei Li wrote:

> Hello all,
> I tried to launch a application named "abc.app" use NSTask, I write code
> as follows:
> NSArray * args = [[NSArray alloc] initWithObjects:@"2", nil];
> [NSTask launchedTaskWithLaunchPath:@"/Users/feil/Desktop/abc.app"
> arguments:args];
> I always get error message:Task create for path abc.app failed.

You need to run the actual executable file, inside of the app wrapper.
Change the path to "/Users/feil/Desktop/abc.app/Contents/MacOS/abc".
----------

Now, I'd like to retrieve the arguments in the launched application.
Ok, I can modifiy the "main(...)" function to get the arguments,
but I'd like to know if there is an other way to do this......

Any idea ?

Thank you in advance.


Best Regards

Yves
----------------------------------------------------------------
Yves Peneveyre direct line : ++41 21 802 5754
Software Engineer fax : ++41 21 802 5751
LooKware development Ltd phone : ++41 21 802 5750
6B, ch du Trisi email: email@hidden
CH - 1028 Priverenges web: http://www.lookware.ch
----------------------------------------------------------------




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.