views:

139

answers:

1

An UIPicker shows up when I select a row in a table, so I can choose some things I want to be displayed on the same row.

How can I update the table once I finished with the uipicker? I used reloadData right after the call to the picker, but the code is executed before I do "Done" on the picker.

Some idea?

Thank u

+1  A: 

USe the UIPicker delegate method pickerView:didSelectRow:inComponent:, and call reloadData from your delegate.

The object with your "done" action should be the delegate of the UIPicker, and implement the delegate method above. In that delegate method call reloadData. It will be called when the picker is done.

Paul Lynch
I've seen where the problem is, I could use didSelectRow or clickedButtonIndex, but what I need is how to call the reloadData from there, as the UIPicker is defined in a different class from the table.thank u
Guille10k
Reread - with edit to make clearer.
Paul Lynch
Maybe the best question would be: How do I call reloadData from my UIPicker class? (which is outside the tableview controller I want to update).The easy way is joining the two classes.
Guille10k
You do that by implementing the delegate method. Really.
Paul Lynch