views:

257

answers:

1

hi , i got a pickerView with 2 components, when i select for exemple the row 1 in the component 1 it will load an array list into the component 2. and if i select the row 2 in the component 1 it will load another array list in the component 2. It is possible?

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {


 return 2; 



}





- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {

 if (component == 0){
  return [arraylist1 count];
 if (component == 1) {
  if ([pickerViewcustom selectedRowInComponent:0] == 0) {
   return [arraylist3 count];
  }
 }
 }




 return 0;

}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {




 if (component == 0){
   return [arraylist1 objectAtIndex:row];
  if (component == 1) {
   if ([pickerViewcustom selectedRowInComponent:0] == 0) {
    return [arraylist3 objectAtIndex:row];
   }
  }

 }

 return 0;

}




- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {



    return 150;
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{




 [pickerViewcustom reloadComponent:0];
 [pickerViewcustom reloadComponent:1];













}
A: