Despite the fact that I can not qualify as an experienced developer, I would do it like this. In the class that will be the data source and delegate of the selection view:
#define PICKER_MIN 45
#define PICKER_MAX 550
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return (PICKER_MAX-PICKER_MIN+1);
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return [NSString stringWithFormat:@"%d", (row+PICKER_MIN)];
}
source
share