Lanzar una aplicación para Mac con Objective-C / Cocoa
Al iniciar la aplicación Path Finder con línea de comandos, usoopen -a Path Finder.app /Users/
. Basado en esta idea, uso el siguiente código para iniciar Path Finder.
¿Puedo iniciar la aplicación sin usaropen
¿línea de comando
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/bin/open"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"-a", @"Path Finder.app", @"/Users/", nil];
[task setArguments: arguments];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
NSFileHandle *file;
file = [pipe fileHandleForReading];
[task launch];