0
私は、インデックス、日時、相談時間を持つ3つのコンポーネントuiピッカーを持っています。1つのコンポーネントが変更されたときにuipickerの複数コンポーネントを読み取る方法
最初のコンポーネントが変更されたときに、2番目と3番目のコンポーネントの値を読み取る必要があります。
コンポーネント1を変更したときにUIPickerの2番目と3番目のコンポーネントを読み取るにはどうすればよいですか?
[email protected][@"Sunday",@"Monday",@"Tuesday",@"Wednesday",@"Thursday",@"Friday",@"Saturday"];
[email protected][@"1",@"2",@"3",@"4",@"5",@"6",@"7"];
[email protected][@"9:00 AM",@"11:00 AM"];
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if(component == 0){
_labelValueIndex.text = [self.indexes objectAtIndex:row];
// When component 1 is spinned read component 2 and component 3 value even if they are not spinned
[days objectAtIndex:row];// incorrect value as row variable is like global if i select indexes[1] . i also get days[1] and timeOfConsultation [1]
// How to read component 2 and component 3 value from component1 change event
}else if (component == 1){
labelValueBookingDay.text = [days objectAtIndex:row];
}
else{
labelValueTimeOfConsultation.text = [timeOfConsultation objectAtIndex:row];
}
}