Instance Method

pickerView:titleForRow:forComponent:

Called by the picker view when it needs the title to use for a given row in a given component.

Declaration

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;

Parameters

pickerView

An object representing the picker view requesting the data.

row

A zero-indexed number identifying a row of component. Rows are numbered top-to-bottom.

component

A zero-indexed number identifying a component of pickerView. Components are numbered left-to-right.

Return Value

The string to use as the title of the indicated component row.

Discussion

If you implement both this method and the pickerView:attributedTitleForRow:forComponent: method, the picker view prefers the pickerView:attributedTitleForRow:forComponent: method. However, if that method returns nil, the picker view falls back to using the string returned by this method.

See Also

Setting the Content of Component Rows

- pickerView:attributedTitleForRow:forComponent:

Called by the picker view when it needs the styled title to use for a given row in a given component.

- pickerView:viewForRow:forComponent:reusingView:

Called by the picker view when it needs the view to use for a given row in a given component.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software