Hi,
I'm a noobie so be nice
I'm creating a basic Cocoa app that needs to run another app from a menu command. I want to include that app inside the bundle's resources folder but I only know how to execute this using a full path. Here is my code thus far:
@implementation AppController
- (IBAction)RunAppid)sender{
NSTask *run;
run=[[NSTask alloc] init];
[run setLaunchPath: @"/usr/bin/open"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"/PATH/TO/APP.app", nil];
[run setArguments: arguments];
[run launch];
[run release];
}
@end
How can I replace the full PATH/TO/APP with a relative path to the Contents/Resources folder of my app? Also, if my code is overly complicated, unnecessary or stupid in any way, feel free to suggest improvements.
Many thanks.
I'm a noobie so be nice
I'm creating a basic Cocoa app that needs to run another app from a menu command. I want to include that app inside the bundle's resources folder but I only know how to execute this using a full path. Here is my code thus far:
@implementation AppController
- (IBAction)RunAppid)sender{
NSTask *run;
run=[[NSTask alloc] init];
[run setLaunchPath: @"/usr/bin/open"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"/PATH/TO/APP.app", nil];
[run setArguments: arguments];
[run launch];
[run release];
}
@end
How can I replace the full PATH/TO/APP with a relative path to the Contents/Resources folder of my app? Also, if my code is overly complicated, unnecessary or stupid in any way, feel free to suggest improvements.
Many thanks.