Reputation: 23
My pickerViews all come from one pickerViewCell
. I generate 5 of them and I need to know how i can identify all these 5 at the same time and get the indexPath.row
from all of them.
Upvotes: 2
Views: 181
Reputation: 932
Initially set tag
value to each picker view.
When you scroll cells of pickerview
, delegate
method of picker view shown below called all the time. By using tag value find which picker view is selected.
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
if(pickerView.tag == 0) {
} else if(pickerView.tag == 1) {
} else if(pickerView.tag == 2) {
}
}
Upvotes: 0
Reputation: 947
you can set the tag
property of each pickerView which is an integer that you can use to identify each
Upvotes: 3