i have read a lto of questions about this, but just can't find the solution.
I simply wont to add a Done button to my NumberPad
- (void)viewDidLoad
{
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardDidShow:)
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (void)addButtonToKeyboard {
    NSLog(@"call");
    // create custom button
    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;
    NSLog(@"%d", [tempWindow.subviews count]);
    for(int i=0; i<[tempWindow.subviews count]; i++) {
        NSLog(@"found");
        keyboard = [tempWindow.subviews objectAtIndex:i];
        [keyboard addSubview:doneButton];
    }
}
- (void)keyboardDidShow:(NSNotification *)note {
    // if clause is just an additional precaution, you could also dismiss it
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2) {
        [self addButtonToKeyboard];
    }
}
This code:
NSLog(@"%d", [tempWindow.subviews count]);
is always 0, so it simply does not adds a button... any idea?
 
     
     
     
    