Reputation: 1005
I've got a pickerview.
I would like to call a specific function each time the list changes (an item is added or removed).
How would I be able to do that ? I have tried a few IB Actions but could not get the function triggered.
Extra:
Here is a little bit more about the project just in case you have a better idea:
I have a ViewController, which has a picker view.
I have a View, that on click of a button, calls a class DataHolder, which ads an item to a dictionary.
This dictionary is linked to the picker view, the picker view updates.
Upvotes: 0
Views: 179
Reputation: 12405
I think you are looking for [pickerView reloadAllComponents];
this will reload all the components of the picker view
Upvotes: 2
Reputation: 4061
use
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
some method;
}
Upvotes: 1