You can implement this code and override the default behavior (i.e. showing the keyboard):
#pragma mark -
#pragma mark UITextFieldDelegate methods
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
message:@"Bouh!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
return NO;
}
, UIAlertView, UIPickerView .