title: Launching an Mac App with Objective-C/Cocoa
body: <p>When launching Path Finder app with command line, I use <code>open -a Path Finder.app /Users/</code>.
  Based on this idea, I use the following code to launch Path Finder.</p>
  
  <p>Can I have launch app without using <code>open</code> command line?</p>
  
  <pre><code>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];
  </code></pre>