Questions tagged [uipickerviewdatasource]

UIPickerViewDataSource is an iOS protocol for defining methods instructing a UIPickerView how many components and rows it should display.

UIPickerViewDataSource is an iOS protocol defining methods instructing a UIPickerView how many components and rows it should display. A picker view can have 1 or more components (the wheels in a slot-machine metaphor), each with an independent number of rows (the writing on the wheels). Two methods return these values:

  • numberOfComponentsInPickerView: - returns the number of wheels
  • pickerView:numberOfRowsInComponent: - returns the number of rows for a given wheel

For more information, please refer to the Apple Documentation for UIPickerViewDataSource.

49 questions
0
votes
3 answers

How can i reach of selected item's title and item's value in picker in swift?

Let me describe view controller (page design) side first. I added one picker view, one label and one button, here is my viewController file import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { …
0
votes
1 answer

DatePickerView Date isn't the same as the date printed on the console

I have the following problem. My code is supposed to trigger a DatePickerView when a button is pressed. (In code it's referred to "deadLineTestButton") and when the user successfully selects a date and a time, the console prints a completely…
0
votes
1 answer

Using UIPickerView inside UITableViewController

I'm trying to add a UIPickerView into my UITableViewController and it doesn't let me enter UIPickerViewDataSource. I'm not able to set the dataSource for the picker view... so how will this work? I get this error: Cannot assign value of type…
Amit Kalra
  • 4,085
  • 6
  • 28
  • 44
0
votes
1 answer

PickerView to return certain text string based on picker selection

What I would like to do is have a certain text string to appear depending on what is selected from the Picker. For instance, the choices Blue, Green, and Yellow are available for selection in the picker. When you choose Blue some text (ex. I LOVE…
0
votes
2 answers

Return 2 variables in swift

I'm a newbie developer, trying to return 2 variables but without any success. Here are what I have already tried: I tried to put these 2 variables (I'm not sure if those are variables or they have different name) into the array and then call…
Latenec
  • 408
  • 6
  • 21
0
votes
0 answers

How to make a picker view dynamically in Xcode in objective c?

I am newbie in iOS.I a trying to make picker view in a navigation toolbar my dates are coming their sucessfully.I need to make a Picker view which fills datasource with 2 names and on selection of it i need to return it in string so that I can…
0
votes
2 answers

viewController does not conform to protocol UIPickerViewDataSource what is wrong with my code?

I have looked through many questions and answers and I cannot find the reason why my app keeps failing. Sorry for the inconvenience but can someone help me out? I am using swift 3. import UIKit import MapKit import CoreLocation class…
0
votes
1 answer

iOS UIPickerView calls numberOfRowsInComponent even UIPickerViewDataSource is not bound

Hi, this question is only about for curiosity. I have UIPickerView in my controller, delegate is bound from IB and implemented in controller, and also one of UIPickerViewDataSource method is implemented in controller numberOfRowsInComponent. This…
Eren
  • 57
  • 6
0
votes
1 answer

How can I clear one of pickerView from two?

I'v got two pickerViews and when user select first after the second pickerView is loading. But if user does it again this action, all datas appending to second pickerView. I have to clear second pickerView content when user select first one. I am…
0
votes
3 answers

Error: Type 'GearViewController' does not conform to protocol 'UIPickerViewDataSource'

Error: Type 'GearViewController' does not conform to protocol 'UIPickerViewDataSource' Based on apple documentation there are only 2 required methods for a UIPickerViewDataSource. Both are included in the code below. I think the syntax is…
Steve M.
  • 60
  • 1
  • 5
0
votes
1 answer

How to return selected value in UIPickerDelegate when created programatically

I have a viewController that has a bunch of inputs on it. Some of them are normal text but some require input from a picker. I decided to move the implementation of each PickerDelegate and PickerDataSource into a separate file to keep things a…
0
votes
1 answer

Multiple UIPickerview Errors

I just wanna let you know that the version of Xcode that I'm working on is 7.1.1. Getting to the point, I have three Pickerviews as is shown in the image below. Main pickerview, left pickerview, and right pickerview. The array of main pickerview…
0
votes
1 answer

Regarding Multiple UIPickerview

I have three Pickerview as it shown in the image below. I main pickerview, left pickerview, and right pickerview. The array of main pickerview has group of names, and each name has group of units. I have made array inside array in order to show…
0
votes
0 answers

Selecting values from the second picker column

I am using a uipicker app where I have two columns of selected data, using this code I can select the values fromm the picker (when it only has one row) - (void)viewDidLoad { [super viewDidLoad]; _pickerData = @[@"item1", @"item2", @"Item 4",…
0
votes
2 answers

CPPickerView DataSource

Using CPPickerView. I have it working and have currently been coding for a bit too long i think and my brain has gone dead so any help would be appreciated. I know the answer is simple but for the life of me i just can't see it. I want to load an…
jkd359
  • 151
  • 4
  • 16