The method pickerView:titleForRow:forComponent:
is a method of the UIPickerViewDelegate
, not the UIPickerView
.
The line:
NSString *time = [self.timePicker pickerView:self.timePicker titleForRow:[self.timePicker selectedRowInComponent:0] forComponent:0];
should be:
NSString *time = [self.timePickerDataDelegate pickerView:self.timePicker titleForRow:[self.timePicker selectedRowInComponent:0] forComponent:0];
or:
NSString *time = [self.timePicker.delegate pickerView:self.timePicker titleForRow:[self.timePicker selectedRowInComponent:0] forComponent:0];