title: NSTextField not noticing lost focus when pressing Tab?
body: <p>I can't seem to find a way to get notified when an NSTextField loses focus by pressing the Tab key. I get a nice <em>textDidEndEditing</em> when clicking another control or when pressing Enter, but not if I change the focus by pressing the Tab key.</p>
  
  <p>Also tried to yank <em>KeyDown</em> and <em>doCommandBySelector</em> for this purpose but I got nowhere.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Forgot to mention, but I tried resignFirstResponder too. This is the code I tried:</p>
  
  <pre><code>- (BOOL)resignFirstResponder
  {
      NSRunAlertPanel(@"", @"Lost Focus",@"OK", nil, nil);
      return [super resignFirstResponder];
  }
  - (BOOL)becomeFirstResponder
  {
      NSRunAlertPanel(@"", @"Got focus",@"OK", nil, nil);
      return [super becomeFirstResponder];
  }
  </code></pre>
  
  <p>Strangely, what happens here is that when getting focus, both becomeFirstResponder and resignFirstResponder are called one after the other. But when changing focus away from the control, neither are.</p>