I have a macOS app, "My prog.app", with several executables. The app is installed to "/Applications/My prog.app" and all executables are located in "/Applications/My prog.app/Contents/MacOS/". The "Contents/MacOS/" folder already contains some command line utilities and the main executables with UI - and everything works fine. Now I have added another executable with a UI and it seems to be mixed up with the main executable - that is, when I look in "Activity Monitor" the name of the new UI executable is "My prog" and I can no longer launch the main executable if the new one is running.
NSString* appName = @"/Applications/My prog.app/Contents/MacOS/NewUIExec";
NSArray *arguments = [NSArray arrayWithObject:@""];
NSTask *task = [[NSTask alloc] init];
[task setArguments: arguments];
[task setLaunchPath: appName];
NSError* pErr;
if ([task launchAndReturnError:&pErr]) {
NSLog(@"Everything ok");
}
What am I doing wrong here?