UITextField lose focus event
<p>I have an UITextField in a MyCustomUIView class and when the UITextField loses focus, I'd like to hide the field and show something else in place.</p>

<p>The delegate for the UITextField is set to MyCustomUIView via IB and I also have 'Did End On Exit' and 'Editing Did End' events pointing to an IBAction method within MyCustomUIView.</p>

<pre><code>@interface MyCustomUIView : UIView { 

IBOutlet UITextField    *myTextField;

}

-(IBAction)textFieldLostFocus:(UITextField *)textField;

@end
</code></pre>

<p>However, neither of these events seem to get fired when the UITextField loses focus. How do you trap/look for this event?</p>

<p>The delegate for the UITextField is set as 'MyCustomUIView' so I am receiving 'textFieldShouldReturn' message to dismiss the keyboard when done. </p>

<p>But what I'm also interested in is figuring when the user presses some other area on the screen (say another control or just blank area) and the text field has lost focus.</p>
