I know its very basic question, but i'm facing a strange behaviour with UIPickerView
.
Here is my scanario - I'm using UIPickerView
in my app. my problem is that when i click on a row didSelectRow
method is not called, however when i scroll rows of picker then its working.
more specific assume that first row on picker is currently selected and if i click on 4th row then didSelectRow
method not fired.
What am i missing?
UPDATE: if i comment this code from viewDidLoad
method then all works fine-
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(dismissKeyboard)];
[self.view addGestureRecognizer:tap];
and
-(void)dismissKeyboard {
[numberTextField resignFirstResponder];
[nameTextField resignFirstResponder];
[cityTextField resignFirstResponder];
[addressTextField resignFirstResponder];
[zipTextField resignFirstResponder];
}