It is allowable (and probably preferable) to make the SearchViewController the delegate of each separate UIPickverView. Remember to include the <UIPickerViewDelegate>
annotation on your SearchViewController's interface (like @interface SearchViewController : UIViewController <UIPickerViewDelegate>
) and the compiler will helpfully remind you if you're missing any required methods; however as of 6.1 there are no required methods in the UIPickerViewDelegate protocol.
Note that every method in the UIPickerViewDelegate protocol takes a UIPickerView as its first argument. Check that argument to see if it is equal to each of your three separate UIPickerViews (and it should certainly be equal to one of them!) and modify the behavior of the delegate methods as needed for each view. You'll end up with code that like this:
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
if (pickerView == self.myFirstPickerView) {
return self.myFirstSearchMethodResultTitles[row];
} else if (pickerView == self.mySecondPickerView) {
return self.mySecondSearchMethodResultTitles[row];
} else if (pickerView == self.myThirdPickerView) {
return self.myThirdSearchMethodResultTitles[row];
} else {
NSAssert(NO, @"Should not have reached this point!");
return nil;
}
}