I have a 2 components, dependent pickerView
. I have a preview UIImageView
that changes each time the user uses the pickerView
(and triggers the didSelectRow:inComponent:
). This works just as I expected.
However, I want the pickerView
to trigger didSelectRow:
when the app launches, so that there is a Preview the moment the user sees the UIImageView
. In viewDidLoad
, when I try this:
[self pickerView:picker didSelectRow:row inComponent:component]; // row and component have 0 values.
next thing that happens - the pickerView
shows up blank! Remove this line, and it works perfectly again. I tried this as well:
[picker selectRow: row inComponent:component animated:NO];
thinking that it will trigger didSelectRow:
however it doesn't trigger it and my UIImageView
remain blank.
Any advice on how to call the didSelectRow:
method without the users help?
Update: by the way, the picker is inside another UIView
(not the main one). In case it matters.