Shishir.bobby
Shishir.bobby

Reputation: 10984

pickerview issue

I have 2 segment UIPickerView one is having number and second "Quantity"

Both segment has None as their first index.

what i m trying to do is, whenever i choose None(first element) from an of the segment, the respective, first element of the other segment should also move to None(which is first element,automatically.) Makes sense??

Guidance needed

Upvotes: 0

Views: 180

Answers (1)

Erik B
Erik B

Reputation: 42574

This is pretty simple, here's the code:

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    if (row == 0) {
        [pickerView selectRow:0 inComponent:((component+1)%1) animated:YES];
    }
}

Upvotes: 1

Related Questions