I was searching for a Done button for the Number Pad,then i saw this question:
How to show "Done" button on iPhone number pad
I copied Archie’s answer code into mine,and i get 2 warnings in this area:
- (void)textFieldDidBeginEditing:(NSNotification *)note {
[self updateKeyboardButtonFor:[note object]];
}
- (void)keyboardWillShow:(NSNotification *)note {
[self updateKeyboardButtonFor:[self findFirstResponderTextField]];
}
- (void)keyboardDidShow:(NSNotification *)note {
[self updateKeyboardButtonFor:[self findFirstResponderTextField]];
}
The warnings are:
Incompatible Objective-C types initializing ‘struct NSNotification *’, expected ‘struct UITextField *’
How can i correct that? I tried to switch with a UITextField but it all messed up
As BoltClock suggested, it does seem a bit strange that Archie use a delegate method’s name as a notification handler. The problem might be stemming from the fact that you must be adopting the
UITextFieldDelegateprotocol. If you’ve done so, remove the line observing the notification,and then edit make the
textFieldDidBeginEditing:method while becoming the delegate of the text fields,Or alternatively, rename the occurrences of
textFieldDidBeginEditing:with some other suitable method name