title: adding custom button to number pad keyboard ios 6
body: <p>I am new in <code>IOS</code> &amp; I am using <code>IOS 6</code>. I have more than one textfield in my code, one of them uses the Number pad keyboard and I want to add the custom button to it.</p>
  
  <p>I am using this code:   </p>
  
  <pre><code> UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
      doneButton.frame = CGRectMake(0, 163, 106, 53);
      doneButton.adjustsImageWhenHighlighted = NO;
      [doneButton setImage:[UIImage imageNamed:@"DoneUp.png"] forState:UIControlStateNormal];
      [doneButton setImage:[UIImage imageNamed:@"DoneDown.png"] forState:UIControlStateHighlighted];
      [doneButton addTarget:self action:@selector(doneButton:) forControlEvents:UIControlEventTouchUpInside];
  
      // locate keyboard view
      UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
      UIView* keyboard;
      for(int i=0; i&lt;[tempWindow.subviews count]; i++) {
          keyboard = [tempWindow.subviews objectAtIndex:i];
          // keyboard view found; add the custom button to it
          if([[keyboard description] hasPrefix:@"&lt;UIPeripheralHost"] == TRUE)
              [keyboard addSubview:doneButton];
        }
  </code></pre>
  
  <p>Selector is called, but the problem is that the <code>[[tempwindow.subviews]count]</code> is 0.</p>
  
  <p>Could anyone help me ?</p>
  
  <p>Thanks in advance.</p>