2

I'm new to Objective-C, and I already have a button with a function to go when the press the button. In the UIPickerView it has lots of numbers going up until who knows how long. I used this code:

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
     return 3;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {

     // Near-infinite number of rows.
     return NSIntegerMax;

}

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

     return [NSString stringWithFormat:@"%d", row];

}

I just need the number that was entered in all three components.

Nathan
  • 151
  • 4
  • 16

1 Answers1

2

The value for each component is found in:

[yourPicker selectedRowInComponent:x]

where x is the component number (0, 1, or 2 in your case).

Matthew Frederick
  • 22,245
  • 10
  • 71
  • 97