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];
}
You shoulf use
forloop for that. The code:EDIT: It will be better when you’ll use
NSMutableArrayinstead.