views:

119

answers:

1

Hello Everyone, I am a newbie in iphone development, yet wondering why i am not able to find any help regarding the keyboard keyup/keydown events, I actually want to detect which key is been pressed by the user via keyboard on iphone while inputting the text in the UITextField. I need an urgent help!! .....

Thanks in advance

Mehroz

+1  A: 

You can use this delegate method to get the character that's being entered into a UITextField:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;

For example:

if ([string isEqualToString:@"z"]){
    // z is being typed.
}

Just make sure you've said your UITextField's delegate to the class file where you implement this.

Tom Irving
Thanks for the help tom :) .... but i ve used a bit different method, i called the desired function via notification centre and then i check the UITextFiled Variable that i defined in the view controller interface.
No problem. Glad you got something working :)
Tom Irving