开发者

Implement PickerView with DataSource depending on Sender Tag

Alright, I have multiple view controllers / views that contain forms with PickerView's. Because the pick开发者_JAVA百科er view is being used so often, I figured I would create a seperate view/view controller for the picker view, so I don't have to declare 2 or 3 different picker views in each of the other view's. My problem is, how can I populate the picker view based on what button is pressed. For example, if the user hits button1 on firstviewcontroller, populate the picker view from firstviewArray and display, or if the user hits button2 on firstviewcontroller, populate the picker view from secondviewArray. Is this the approach I should take? Or should I just individually create the pickerviews for each possible selection? Any help/articles/source code would be appreciated!


Can't you pass the array into the view controller dedicated for the picker view?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜