2

I want to do somenthing with the UIPickerView but I simple can't see how I can solve this problem...

This example is similar to what I want, and easily understandable. I have two simple pickers, with numbers from 0 to 10. Then I have a textfield where the user inserts a number.

What I want is that when the users inserts, for example, 7, and then selects a number in one of the pickers, like 5, the other pickers moves to 2, so that the sum is 7. The same with 0 and 7, 3 and 4.

Basically, how to make a picker move, according to the other picker value selected, based on the input inserted before.

Thank you very much :)

4

3 に答える 3

0

次のように配列を追加してコンポーネントをリロードします。

- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

    if (component == 0) {
        club=[[NSString alloc] initWithFormat:@"%@" , [Nations objectAtIndex:row]];
      [secondcomponearray addObject club];
        [pickerView reloadComponent:1];

}
于 2013-05-27T11:45:59.597 に答える