I need to create two UIPickers Dynamically with different input values.
I did n’t find correct solution in google.
Can any pls post some code.
Thank u in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two approaches to this.
a) First, make the view controller the delegate and data source of both the pickers. Then in the view controller’s implementation do something like this:
Note that you compare the pickerView parameter to an instance variable pointing to one of your picker views and decide “on the fly” which values to return for each of the picker views.
b) Assign different data sources and delegates to each of the picker views (they may be any objects implementing UIPickerViewDelegate and UIPickerViewDataSource protocols, not necessarily the view controller).