I have 2 UIPickerViews on the same screen. I have the first one working and displaying and returning data. I added a second UIPicker and I have it returning values. However, my viewDidLoad function doesn't seem to be working properly.
The first UIPicker loads and the string values are added and visible. However, my second UIPicker is not displaying my string values. But is returning values when I flick over the picker. The data is not being shown in the UI. It is blank.
Here is the code from viewDid Load:
Any help or direction would be greatly appreciated.
The first UIPicker loads and the string values are added and visible. However, my second UIPicker is not displaying my string values. But is returning values when I flick over the picker. The data is not being shown in the UI. It is blank.
Here is the code from viewDid Load:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
meterPickerViewArray = [[NSMutableArray alloc] init];
for (int i = 0; i <= 9; i ++) { // Set 'i' to every number from 1 to 9.
NSString *myString = [NSString stringWithFormat:@"%d", i];
[meterPickerViewArray addObject:myString]; //Add string to tableviewarray.
}
timeSecondsPickerViewArray = [[NSMutableArray alloc] init]; //This seems to be the part not working correctly.
for (int ts = 0; ts <= 59; ts ++) {
NSString *mySecondString = [NSString stringWithFormat:@"%d", ts];
[timeSecondsPickerViewArray addObject:mySecondString];
}
}
Any help or direction would be greatly appreciated.