Good Saint Jesus, you call didSelectRow:component: recursively!
I know that the method of processing the parameters does not allow it to go through more than two levels, but still do not do this. Someday.
It is not possible to prevent multiple components from rotating at the same time. It is the joy of multitouch and iOS, so that everything sets in motion and watches how all this is consistent with a consistent state. And since spinner components take time to solve a problem, the user can customize them for each user using only one finger. You must learn to write your code accordingly.
In this case, you want to delete all calls to didSelectRow:component: from itself - it should be called only by the system. You are on the right track using reloadComponent: , it's just that you are not reloading them enough:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { NSLog(@"Selecting row %d component %d", row, component); [self updateSelection];
I don't know what your updateSelection - apparently, it sets the data model based on the pickerView value. This is good - but it should happen at the top of your method, so when you call your titleForRow or viewForRow , it has the appropriate data to select from. Also, from any of these three ( update , titleFor , viewFor ) values do not state values โโin the collector! Just read it.
I think this is a good starting point for you, but you will have to pick things up a little here and there when you approach your goal. I think you will find that the key to Pickers is that they only claimed didSelectRow:component: when one of the spinner components of a thing settles to a value, and they are really good at continuing to spin if you reload them. Make it a shot and see if you can make some progress, send the word back if you're stuck.
source share