title: How to quit itself in Objective-C application?
body: <p>I have a URLHandler that launches some application, the main code is as follows.</p>
  
  <pre><code>@implementation URLHandlerCommand
  
  - (id)performDefaultImplementation {
      NSString *urlString = [self directParameter];
  
      NSLog(@"url :=: %@", urlString);
  
      NSTask *task;
      task = [[NSTask alloc] init];
      [task setLaunchPath: @"/usr/bin/open"];
  
      NSArray *arguments;
      arguments = [NSArray arrayWithObjects: @"-a", @"Path Finder.app", urlString, nil];
      [task setArguments: arguments];
  
      NSPipe *pipe;
      pipe = [NSPipe pipe];
      [task setStandardOutput: pipe];
  
      NSFileHandle *file;
      file = [pipe fileHandleForReading];
  
      [task launch];
  
      return nil;
  }
  </code></pre>
  
  <p>As the goal of this routine is to launch another application, I'd like to make this URLHandler quit after launching an App. How can I do that?</p>