title: NSApplication resigning front most application status: hide v. deactivate
body: <p>I've got an application that needs to become the front most application after a timer expires and resign the front most status when the timer is started by pressing a button, e.g.</p>
  
  <ul>
  <li>click "start timer" -> app resigns front most application</li>
  <li>timer expires -> app becomes front most application</li>
  </ul>
  
  <p>I deliberately paraphrased things a little because playing with active status of the <code>sharedApplication</code> doesn't do what I want.</p>
  
  <p>I become the front most app by doing a <code>[[NSApplication sharedApplication] activateIgnoringOtherApps: YES]</code> and that works perfectly well.</p>
  
  <p>Doing the reverse seems impossible!?</p>
  
  <ul>
  <li><p><code>[[NSApplication sharedApplication] deactivate]</code> shouldn't be called directly, but more importantly doesn't bring the next application in the "command-tab order" forwards. The app just sits there with its menu bar showing but it's no longer "<em>active</em>".</p></li>
  <li><p><code>[[NSApplication sharedApplication] hide: self]</code> resigns the active status and brings the next application in the "<em>Command-tab order</em>" to the front BUT it also hides all the application windows.</p></li>
  </ul>
  
  <p>I need some way of bringing the next application in the command-tab order to the front WITHOUT hiding all my windows.</p>
  
  <p>Is there a good way of doing that?</p>
  
  <p>The solution should be 10.5 Leopard and 10.6 compatible.</p>
  
  <p>I do have a solution from around 1996 but it involves Carbon APIs and I'd really prefer doing it the Cocoa or at least Foundation way..</p>
  
  <p>Any help would be greatly appreciated.</p>