iOS 8
Xcode 6.3
I have a picker view which has 2 components. I bring the picker view once user clicked on a textfield.
Once user selects a value in picker view it disappears!
Please see code below:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
if (component == 0) {
ccYearTF.text = [NSString stringWithFormat:@"%i", [pickerView selectedRowInComponent:0] + 2015];
}
else {
ccMonthTF.text = [NSString stringWithFormat:@"%02d", [pickerView selectedRowInComponent:1] + 1];
}
}
If I don't set value of the textfields it works normally and doesn't disappear, but if I set textfield's value then it disappears. Who can tell why is this happening?