I'm trying to have to different UIpickerViews with different methods, however every example I see, use the same methods:
The closest example I can find, suggest to use the .tag to ID each different pickerView. Then use an "if" inside the method to determine which picker is which.
The Apple docs say:
and
But I can't seem to find any examples of this.
Can anyone point to an example of a UIPickerView done programmatically that uses a custom UIPickerViewDelegate?
My guess it would involve changing myPicker.delegate = self; to myPicker.delegate = _____ However I can't seem to find an example in the Apple docs or StackOverflow.
I probably should have made it clear that I wanted this to not call the standard delegate so that it doesn't change the other pickers.
Code:
- (NSString *)pickerView:(UIPickerView *)picker titleForRow:(NSInteger)row forComponent:(NSInteger)component;
{
return [[self.pickerData objectAtIndex:component] objectAtIndex:row];
}
The closest example I can find, suggest to use the .tag to ID each different pickerView. Then use an "if" inside the method to determine which picker is which.
The Apple docs say:
A UIPickerView object requires the cooperation of a delegate for constructing its components and a data source for providing the numbers of components and rows. The delegate must adopt the UIPickerViewDelegate protocol and implement the required methods to return the drawing rectangle for rows in each component.
and
The UIDatePicker class uses a custom subclass of UIPickerView to display dates and times.
But I can't seem to find any examples of this.
Can anyone point to an example of a UIPickerView done programmatically that uses a custom UIPickerViewDelegate?
My guess it would involve changing myPicker.delegate = self; to myPicker.delegate = _____ However I can't seem to find an example in the Apple docs or StackOverflow.
I probably should have made it clear that I wanted this to not call the standard delegate so that it doesn't change the other pickers.