Reputation: 1
I have two columns, in the uipicker. When I select something from the first column, I want the options to change on the other column.
Source code anyone?
Thanks a bunch
Upvotes: 0
Views: 176
Reputation: 22873
try something like this -
- (void)pickerView:(UIPickerView *)pickerView
didSelectRow:(NSInteger)row
inComponent:(NSInteger)component {
if (component == 0) {
//Here First Part of the Pickerview is represented using 0.
// dependentPicker is the Pickerview outlet
[dependentPicker selectRow:row inComponent:1 animated:YES];
[dependentPicker reloadComponent:1];
}
else
{
[dependentPicker selectRow:row inComponent:0 animated:YES];
[dependentPicker reloadComponent:1];
}
}
Upvotes: 0
Reputation: 147
Check out the book 'Iphone 4 development' from Apress, at chapter 7 there is made a dependent picker, the one that you want to make (it's called a dependent uipickerview).
Upvotes: 0