Q:

How to set a lot of values to UIPickerView?

I have a pickerview with 2 rows and I need to fill them automatically. First row: numbers from 150 to 210 and second row: from 40 to 130. Can anyone help me with this?
My code:
- (void)viewDidLoad {

    NSArray *ar1 = [[NSArray alloc]initWithObjects:@"150", @"151", @"152", nil];
    self.array1 = ar1;
    [ar1 release];

    NSArray *ar2 = [[NSArray alloc]initWithObjects:@"40", @"41", @"42", nil];
    self.array2 = ar2;
    [ar2 release];

        [super viewDidLoad];

}

A:

You shoulf use for loop for that. The code:
NSArray *ar1 = [NSArray array];
for (int i = 150; i <= 210; i++)
    ar1 = [ar1 arrayByAddingObject:[NSString stringWithFormat:@"%d",i]];
[ar1 retain];
self.array1 = ar1;

NSArray *ar2 = [NSArray array];
for (int j = 40; j <= 130; j++)
    ar2 = [ar2 arrayByAddingObject:[NSString stringWithFormat:@"%d",j]];
[ar2 retain];
self.array2 = ar2;

EDIT: It will be better when you'll use NSMutableArray instead.
NSArray *ar1 = [[NSMutableArray alloc] init];
for (int i = 150; i <= 210; i++)
    [ar1 addObject:[NSString stringWithFormat:@"%d",i]];
self.array1 = ar1;

NSArray *ar2 = [[NSMutableArray alloc] init];
for (int j = 40; j <= 130; j++)
    [ar2 addObject:[NSString stringWithFormat:@"%d",j]];
self.array2 = ar2;

