title: How to find out what UITextField caused a UIKeyboardWillShowNotification?
body: <p>I am trying to use a customized keyboard in my application, but I am hitting problems when trying to restrict it to one particular UITextField.</p>
  
  <p>I based my code on <a href="http://billabonger.net/blog/wp-content/uploads/2009/01/customnumberpad-example.zip" rel="noreferrer">this Xcode project</a> (originally found on <a href="http://billabonger.net/blog/2009/01/add-a-decimal-to-uitextfield-number-pad-keyboard/" rel="noreferrer">this blog</a>).  That code adds a custom UIButton (representing a 'decimal point') into the UIKeyboardTypeNumberPad keyboard view.  It does it by subscribing to UIKeyboardWillShowNotification and modifying the keyboard when it appears.</p>
  
  <p>That Xcode project works great, but when I add an extra UITextField, the custom key gets put into the keyboard for that text field too, even though I have selected a completely different keyboard type for that text field.</p>
  
  <p>I attempted to register to only see UIKeyboardWillShowNotification notifications from the one particular UITextField, but that doesn't seem to work:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:exampleViewController.textField];
  </code></pre>
  
  <p>I also tried to inspect the object inside the NSNotification passed to keyboardWillShow, but unfortunately it refers to the keyboard, not the UI control that caused the keyboard to appear.</p>
  
  <pre><code>2009-10-21 19:50:22.205 Example[6302:207] NSConcreteNotification 0x321ebd0 {name = UIKeyboardWillShowNotification; userInfo = {
  UIKeyboardAnimationCurveUserInfoKey = 0;
  UIKeyboardAnimationDurationUserInfoKey = 0.300000011920929;
  UIKeyboardBoundsUserInfoKey = NSRect: {{0, 0}, {320, 216}};
  UIKeyboardCenterBeginUserInfoKey = NSPoint: {160, 588};
  UIKeyboardCenterEndUserInfoKey = NSPoint: {160, 372};
  </code></pre>
  
  <p>}}</p>
  
  <p>Am I misunderstanding the addObserver interface?  Surely there must be a way to subscribe to notifications from a particular UI control?</p>
  
  <p>Has anybody got any other suggestions on how to achieve this?</p>