title: -[NSRunningApplication activateWithOptions:] not working
body: <p>I'm trying to create a program that will focus a certain application (if it is launched). Here is my code:</p>
  
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  #import &lt;stdio.h&gt;
  
  int main() {
    // activate Firefox
    NSArray *apps = [NSRunningApplication runningApplicationsWithBundleIdentifier: @"org.mozilla.firefox"];
  
    if ([apps count] == 0) {
      printf("no matching app\n");
      return 1;
    }
  
    if (![apps[0] activateWithOptions: NSApplicationActivateAllWindows]) {
      printf("failed to activate\n");
      return 1;
    }
  
    return 0;
  }
  </code></pre>
  
  <p>When I run this, it prints "failed to activate," and Firefox is not brought into focus. What am I doing wrong?</p>