I know that with a UIDatePicker, you can use something like:
NSDate *myDate = picker.date;
But I am using a UIPickerView in my view. How c
You can get it in the following manner:
NSInteger row;
NSArray *repeatPickerData;
UIPickerView *repeatPickerView;
row = [repeatPickerView selectedRowInComponent:0];
self.strPrintRepeat = [repeatPickerData objectAtIndex:row];
You can get the text of the selected item in any section of the picker using the same function that the pickerView does, from your custom ViewController class:
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
using the selected item
[myPickerView selectedRowInComponent:0]
so to set the text of a label in a custom cell using the currently selected value from the 2nd section of myPickerView (a property of your view controller probably)
[cell.label setText:[self pickerView:myPickerView titleForRow:[myPickerView selectedRowInComponent:1] forComponent:1]];
Just change both :1s to :2s, etc for each section
You can access the selected row for a given component using the following method:
- (NSInteger)selectedRowInComponent:(NSInteger)component
Otherwise, implementing the delegate function is the only other option.
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
weightSelected = [pickerArray objectAtIndex:row];
}