Two pickers in a view sounds crazy ugly. Would it really not work for you to have a picker with two components (ie, columns)?
Nevertheless, the first parameter in every method defined by UIPickerViewDelegate
is the picker that called you. If you have wired an IBOutlet to each UIPickerView, then you should be able to compare this parameter to those outlets to figure out which one has called you. Something like this:
IBOutlet UIPickerView *fooPicker;
IBOutlet UIPickerView *barPicker;
// ...
- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row forComponent:(NSInteger)component {
if (pickerView == fooPicker)
return [NSString stringWithFormat @"Foo row %d", row];
else
return [NSString stringWithFormat @"Bar row %d", row];
}
It might be cleaner to connect to different objects as your delegates, but with two pickers in one view, "clean" probably isn't an option for you anyways.