Я работаю над тем, когда пользователь нажимает текстовое поле, отображается представление выбора. есть несколько текстовых полей и видов подбора.
Я могу заполнить numberOfRowsInComponent, но не numberOfRowsInSection.Picker View и текстовые поля numberOfRowsInSection
вот код:
-(NSInteger)pickerView:(UIPickerView *) pickerView numberOfRowsInComponent:(NSInteger)component {
NSUInteger count = 0;
if (self.schoolPicker) {
count = [self.infoLibrary.school count];
}
if (self.majorPicker) {
count = [self.infoLibrary.major count];
}
if (self.classPicker) {
count = [self.infoLibrary.classPicker count];
}
if (self.nationalityPicker) {
count = [self.infoLibrary.nationality count];
}
if (self.commuterPicker) {
count = [self.infoLibrary.commuter count];
}
if (self.honorsPicker) {
count = [self.infoLibrary.honors count];
}
if (self.varsityAthletePicker) {
count = [self.infoLibrary.varsityAthlete count];
}
return count;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSString *count = 0;
if (self.schoolPicker) {
count = [self.infoLibrary.school objectAtIndex:row];
}
if (self.majorPicker) {
count = [self.infoLibrary.major objectAtIndex:row];
}
if (self.classPicker) {
count = [self.infoLibrary.classPicker objectAtIndex:row];
}
if (self.nationalityPicker) {
count = [self.infoLibrary.nationality objectAtIndex:row];
}
if (self.commuterPicker) {
count = [self.infoLibrary.commuter objectAtIndex:row];
}
if (self.honorsPicker) {
count = [self.infoLibrary.honors objectAtIndex:row];
}
if (self.varsityAthletePicker) {
count = [self.infoLibrary.varsityAthlete objectAtIndex:row];
}
return count;
}