I am new to IOS i want to create multiple textfield with only one picker progamatically. Suppose i need five textfield means if i clicked first textfield picker view can load the first array then i go to second textfield means picker view can load second array automatically and goes on upto last field and array.please give me idea and suggestion based on my problem.
Follow this steps to achieve your goal.
Download below generic classes from given link:
LabeledPickerView.h
LabeledPickerView.m
Copy this class into your project and import "LabeledPickerView.h" into your ViewController.h file. Also, Add UIPickerViewDataSource, UIPickerDelegate and UITextFieldDelegate.
Now, initialized Picker with following method:-
-(LabeledPickerView *)GetPickerViewWithTag:(int)Tag {
LabeledPickerView *pickerView = [[LabeledPickerView alloc] init];
pickerView.dataSource = self;
pickerView.delegate = self;
pickerView.tag = Tag;
pickerView.backgroundColor = [UIColor whiteColor];
pickerView.showsSelectionIndicator = YES;
return pickerView;
}
This method will return PickerView's properties.
Now, We'll add data into this using UIPickerView Delegate and Data Source Methods as follow:-
//Based on the text fields tags, you can populate the data in PickerView.
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1; //Returns components in PickerView. Change with switch - case statement if you want more components in any of the text fields.
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
int tag = (int)((UIPickerView *)pickerView).tag;
switch (tag) {
case 10: {
if (YourArray.count > 0) {
return [YourArray count];
}
else {
return 0;
}
break;
}
default:
break;
}
return 0;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
int tag = (int)((UIPickerView *)pickerView).tag;
switch (tag) {
case 10: {
if ([YourArray count] > 0) {
return [YourArray objectAtIndex:row];
}
else {
return #"";
}
break;
}
default:
break;
}
return #"";
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
int tag = (int)((UIPickerView *)pickerView).tag;
switch (tag) {
case 10: {
if ([YourArray count] > 0) {
YourTextField.text = [YourArray objectAtIndex:row];
}
else {
txtCity.text = #"";
}
break;
}
default:
break;
}
}
Now, Open Picker When You Start Editing as follow:
-(void)textFieldDidBeginEditing:(UITextField *)textField {
if (textField == firstTextField) {
LabeledPickerView *picker = [self GetPickerViewWithTag:10]; //Change tag as text field changes..
textField.inputView = picker;
[picker selectRow:0 inComponent:0 animated:YES];
[self pickerView:picker didSelectRow:0 inComponent:0];
}
}
In this method add as many text fields you have. Do't forget to assign different tags to each text field.
By Using above code, You can use single picker view with multiple text fields.
Happy Coding..!!
May be this will help you,
i done the same code in my project and it working. here i give you code for three textfields.
NSMutableArray *pickerTitleData, *pickerCityData, *pickerStateData;
#property (strong, nonatomic) IBOutlet UItextfield *txtTitle;
#property (strong, nonatomic) IBOutlet UItextfield *txtTitle;
#property (strong, nonatomic) IBOutlet UItextfield *txtTitle;
UIPickerView *TitleSelect,*CitySelect, *StateSelect;
for address type
pickerTitleData =[[NSMutableArray alloc]initWithObjects:#"Home",#"Office",#"Other", nil];
TitleSelect = [[UIPickerView alloc]init];
TitleSelect.dataSource = self;
TitleSelect.delegate = self;
TitleSelect.showsSelectionIndicator = YES;
txtTitle.inputView = TitleSelect;
// same you have three other array
#pragma mark - Picker View Data source for city
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
#try
{
if (pickerView == TitleSelect)
{
return pickerTitleData.count;
}
else if (pickerView == CitySelect)
{
return pickerCityData.count;
}
else if (pickerView == StateSelect)
{
return pickerStateData.count;
}
return 1;
}
#catch (NSException *exception)
{
NSLog(#"exception--%#",exception.description);
}
}
#pragma mark- Picker View Delegate for city
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
#try
{
if (pickerView == TitleSelect)
{
[txtTitle setText:[pickerTitleData objectAtIndex:row]];
}
else if (pickerView == CitySelect)
{
[txtTownOrCity setText:[pickerCityData objectAtIndex:row]];
}
else if (pickerView == StateSelect)
{
[txtState setText:[pickerStateData objectAtIndex:row]];
}
}
#catch (NSException *exception)
{
NSLog(#"%#",exception.description);
}
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
#try
{
if (pickerView == TitleSelect)
{
return pickerTitleData[row];
}
else if (pickerView == CitySelect)
{
return pickerCityData[row];
}
else if (pickerView == StateSelect)
{
return pickerStateData[row];
}
return #"";
}
#catch (NSException *exception)
{
NSLog(#"%#",exception.description);
}
}
Related
enter image description here $ The data of assigned array is not showing in the pickerView. What mistake I am doing as I haven't being able to identify my mistake.
Its .m file code:
// PickerViewController.m
// dropDownButtonTry
//
#import "PickerViewController.h"
#interface PickerViewController ()
{
NSArray *genderArray;
NSArray *cityArray;
NSArray *currentArray;
UITextField *currentTextField;
}
#end
#implementation PickerViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
cityArray = [[NSArray alloc]initWithObjects:#"Delhi",#"Mumbai",#"Chennai", nil];
genderArray = [[NSArray alloc]initWithObjects:#"Male",#"Female",#"Transgender", nil];
self.pickerView.hidden = YES;
self.btnDoneOutlet.hidden = YES;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
//Needed to prevent keyboard from opening
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
currentTextField = textField;
if (textField == self.textFieldGenderOutlet) {
currentArray = genderArray;
}
if (textField == self.textFieldCityOutlet) {
currentArray = cityArray;
}
// do here everything you want
NSLog(#"Pressed on TextField!");
self.pickerView.hidden = NO;
self.btnDoneOutlet.hidden = NO;
[self.view endEditing:YES]; // Hide keyboard
NSLog(#"****current array**** %#",currentArray);
return NO;
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return [currentArray count];
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
[currentTextField setText:[currentArray objectAtIndex:row]];
}
-(NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return [currentArray objectAtIndex:row];
}
- (IBAction)textFieldGenderAction:(id)sender {
self.pickerView.hidden = NO;
self.btnDoneOutlet.hidden = NO;
}
- (IBAction)btnDone:(id)sender {
self.pickerView.hidden = YES;
self.btnDoneOutlet.hidden = YES;
}
- (IBAction)textFieldCityAction:(id)sender {
}
#end
You need to reload picker view :
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
currentTextField = textField;
if (textField == self.textFieldGenderOutlet) {
currentArray = genderArray;
}
if (textField == self.textFieldCityOutlet) {
currentArray = cityArray;
}
// do here everything you want
NSLog(#"Pressed on TextField!");
self.pickerView.hidden = NO;
self.btnDoneOutlet.hidden = NO;
[self.thePicker reloadAllComponents];
[self.view endEditing:YES]; // Hide keyboard
NSLog(#"****current array**** %#",currentArray);
return NO;
}
currentArray is assigned value in textFieldShouldBeginEditing but it is not initialized anywhere in your code.
Just initialize currentArray in viewDidLoad like below:
currentArray = [NSArray new];
I'm creating UIPickerView with 2 components, for minutes and seconds. I've created picker in UI and want to fill it with data and below is code how I fill it with numbers from 0 - 59. I want to make it look like circular thats why kSizeOfPicker is 60000. When user press the button window with picker appears but it slows app very much, because this
code is in viewDidLoad. How can I fix it?
NSString *stringValue = [[NSString alloc] init];
for(int i=0; i<kSizeOfPicker; i++)
{
stringValue = [NSString stringWithFormat:#"%d", i%60];
[_minutesArray addObject:stringValue];
[_secondsArray addObject:stringValue];
}
and here are data source and delegate methods:
#pragma mark - UIPickerView DataSource Methods
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 2;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent : (NSInteger)component
{
if (component==0)
{
return [_minutesArray count];
}
else
{
return [_secondsArray count];
}
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
NSString *title;
switch (component)
{
case 0:
title = [NSString stringWithFormat:#"%# minutes", [_minutesArray objectAtIndex:row]];
return title;
break;
case 1:
title = [NSString stringWithFormat:#"%# seconds", [_secondsArray objectAtIndex:row]];
return title;
break;
}
return nil;
}
#pragma mark - UIPickerView Delegate Methods
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
if (component == 0)
_firstComponent = [_minutesArray objectAtIndex:row];
else
_secondComponent = [_secondsArray objectAtIndex:row];
}
You don't need prepare all data in NSArray to archive circular pickerview.
Following code virtually prepares +-50 duplicate datasets around selected row.
In pickerView:didSelectRow:inComponent: delegate method, you can reset selected row.
#interface MyViewController () <UIPickerViewDataSource, UIPickerViewDelegate>
#property (weak, nonatomic) IBOutlet UIPickerView *pickerView;
#property (assign, nonatomic) NSUInteger minutes;
#property (assign, nonatomic) NSUInteger seconds;
#end
#implementation MyViewController
#define VALUE_THRESHOLD 60
#define PICKER_DUPLICATES 100
#define CENTER_ROW (VALUE_THRESHOLD * PICKER_DUPLICATES / 2)
- (void)viewDidLoad {
[super viewDidLoad];
[_pickerView selectRow:_minutes + CENTER_ROW inComponent:0 animated:NO];
[_pickerView selectRow:_seconds + CENTER_ROW inComponent:1 animated:NO];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 2;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return VALUE_THRESHOLD * PICKER_DUPLICATES;
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [NSString stringWithFormat:#"%d", row % VALUE_THRESHOLD];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
NSInteger actualRow = row % VALUE_THRESHOLD;
// reset to center dataset
[pickerView selectRow: actualRow + CENTER_ROW inComponent:component animated:NO];
// do anything what you want;
if(component == 0) {
_minutes = actualRow;
}
else {
_seconds = actualRow;
}
}
#end
Use UIDatePicker instead of 60000 iterations it will make your life easier. Set its mode to Time.
If the problem is loading time due to heavy data than either you can put these code in view did appear or you can put the code in Dispatch queue , It will not block your main thread and let your screen loads quickly.
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
//Background Thread
// here you can do your heavy operation
dispatch_async(dispatch_get_main_queue(), ^(void){
//Update your UI
});
});
Or if you want to display time only than you can use UIDatePicker and set its mode :
Date Picker Mode
The mode of the date picker.
typedef enum {
UIDatePickerModeTime,
UIDatePickerModeDate,
UIDatePickerModeDateAndTime,
UIDatePickerModeCountDownTimer
} UIDatePickerMode;
Hope it helps you.
Thank you.
I'm using the custom MZFormSheetController to use the custom "alert view". I have a button when I press it, it opens the MZFormSheetController and allows me to select a specific title for this button from UIPickerView. When I select the title from the picker, it is send to the viewController that contains the button by setNeedsDisplay
I want to change the title of the button with the selected title from the pickerView. I wrote the code but the title of the button doesn't updated..
In the button's viewController, The action of the button:
-(IBAction)openSelectCountries:(id)sender{
UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:#"countriesPickerViewController"];
MZFormSheetController *formSheet = [[MZFormSheetController alloc] initWithViewController:vc];
formSheet.transitionStyle = MZFormSheetTransitionStyleSlideFromTop;
formSheet.shadowRadius = 2.0;
formSheet.shadowOpacity = 0.3;
formSheet.shouldDismissOnBackgroundViewTap = YES;
formSheet.shouldCenterVerticallyWhenKeyboardAppears = YES;
[formSheet presentAnimated:YES completionHandler:^(UIViewController *presentedFSViewController) {
}];
}
in viewDidLoad:
// selectedCountryIndex2 is a static NSString
if (selectedCountryIndex != 0) {
selectedCountryIndex2 = selectedCountryIndex;
}
NSLog(#"selectedCountryIndex2: %d", selectedCountryIndex2);
if (selectedCountryIndex2 == 0) {
NSLog(#"no country selected");
}else{
NSLog(#"the selected country: %#", [countryArray objectAtIndex:selectedCountryIndex2]);
[countrySelect setTitle:[countryArray objectAtIndex:selectedCountryIndex2] forState: UIControlStateNormal];
}
in CountriesPickerViewController.m:
- (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
- (NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return [countryArray count];
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [countryArray objectAtIndex:row];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
NSLog(#"in pickerView: %#", [countryArray objectAtIndex:row]);
ContactUsViewController *contactUsViewController = [self.storyboard instantiateViewControllerWithIdentifier:#"contactUsViewController"];
contactUsViewController.selectedCountry = [countryArray objectAtIndex:row];
contactUsViewController.selectedCountryIndex = row;
[contactUsViewController.view setNeedsDisplay];
// to close the custom dialog
UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:#"countriesPickerViewController"];
MZFormSheetController *formSheet = [[MZFormSheetController alloc] initWithViewController:vc];
[formSheet dismissFormSheetControllerAnimated:YES completionHandler:nil];
}
The expected thing is that the countrySelect button change its title when selectedCountryIndex2 is not equal 0 but this never happen although that the title is passed successfully and I got it by NSLog.
I have been working on a multi-component picker and I wanted to set the defaults for the various components. The code looks like the following.
#import "MathTablesSelectVC.h"
#interface MathTablesSelectVC ()
#property (weak, nonatomic) IBOutlet UIPickerView *problemDifficultyTypeTable;
#property NSArray *problemDifficulties;
#property NSArray *problemTypes;
#property NSArray *problemTables;
#end
#implementation MathTablesSelectVC
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
NSLog(#"0");
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
NSLog(#"1");
[super viewDidLoad];
_problemDifficulties = #[#"Practice", #"Slow", #"Normal", #"Fast"];
_problemTypes = #[#"Addition", #"Subtraction", #"Multiplication", #"Division", #"Remainders"];
_problemTables = #[#" 0's", #" 1's", #" 2's", #" 3's", #" 4's", #" 5's", #" 6's", #" 7's", #" 8's", #" 9's", #"10's", #"11's", #"12's", #"All"];
}
-(void)viewWillAppear:(BOOL)animated {
NSLog(#"2");
[super viewWillAppear:animated];
[_problemDifficultyTypeTable selectRow:1 inComponent:0 animated:NO];
[_problemDifficultyTypeTable selectRow:0 inComponent:1 animated:NO];
[_problemDifficultyTypeTable selectRow:1 inComponent:2 animated:NO];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
NSLog(#"3");
return 3;
}
-(CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
NSLog(#"4");
if(component == 0) {
return 150.0;
} else if(component == 1) {
return 300.0;
} else {
return 75.0;
}
}
-(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component {
NSLog(#"5");
return 60.0;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
NSLog(#"6");
if(component == 0) {
return [_problemDifficulties count];
} else if(component == 1) {
return [_problemTypes count];
} else {
return [_problemTables count];
}
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSLog(#"7");
if(component == 0) {
return [_problemDifficulties objectAtIndex:row];
} else if(component == 1) {
return [_problemTypes objectAtIndex:row];
} else {
return [_problemTables objectAtIndex:row];
}
}
-(void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
NSLog(#"8");
}
-(void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
NSLog(#"9");
}
-(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSLog(#"10");
}
#end
Now this all worked nicely for a while and then it stopped working :(
I then spent the next several hours working out what I'd done wrong.
The answer I stuffed things up when I did some refactoring. I managed to kill the connection between the storyboard and the IBOutlet. Now the nice small, very small, little circle was still there next to the #property it just no longer had a dot in it. As soon as I re-established the connection things started behaving again.
You'll also note a whole bunch of NSLog's and this seems to be the order things are first called in. We get several repeats of some of the numbers as we cycle through the components.
The other thing I broke although I picked that up pretty much straight away were the delegation connections.
I have a profile form as part of a registration process for an iOS app.
I would like to use a 'drop down' menu for items such as gender, title, DOB etc. The data for each will be static - I will use the UIPickerView to implement - but my question is - do I need to create arrays and data delegates to populate each individual picker or is there a simpler way to apply static data?
Can you do it without a delegate? No.
Can you do it without an array? Yes, but you shouldn't.
Here is an example without an array (from http://cocoamatic.blogspot.com/2010/08/create-uipickerview-programmatically.html).
- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component {
// Handle the selection
}
// tell the picker how many rows are available for a given component
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
NSUInteger numRows = 3;
return numRows;
}
// tell the picker how many components it will have
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
// tell the picker the title for a given component
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSString *title;
title = [#"" stringByAppendingFormat:#"Row %d",row];
return title;
}
// tell the picker the width of each row for a given component
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
int sectionWidth = 300;
return sectionWidth;
}
However, you really should just use an array it makes it so much easier to read an maintain. If you want to add an additional value, you just add it to your array. Instead of updating in multiple spots, just add another value to your array. Also, much easier to understand.
#implementation PickerViewController
.
.
- (void)viewDidLoad {
[super viewDidLoad];
_myArray = #[#"Row 1", #"Row 2", #"Row 3",];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component {
// Handle the selection
}
// tell the picker how many rows are available for a given component
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
NSUInteger numRows = 3;
return _myArray.count;
}
// tell the picker how many components it will have
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
// tell the picker the title for a given component
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSString *title;
title = myArray[row];
return title;
}
// tell the picker the width of each row for a given component
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
int sectionWidth = 300;
return sectionWidth;
}
If you had multiple pickers, you would just use multiple arrays and check each PickerView to see which one you had since the PickerView is passed into each of the functions listed.
#implementation PickerViewController
.
.
- (void)viewDidLoad {
[super viewDidLoad];
_myArray1 = #[#"Row 1", #"Row 2", #"Row 3",];
_myArray2 = #[#"Row 1-2", #"Row 2-2", #"Row 3-2", #"Row 4-2"];
UIPickerView pickerView1 = [[UIPickerView alloc] init];
UIPickerView pickerView2 = [[UIPickerView alloc] init];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component {
// Handle the selection
if (pickerView == pickerView1)
{
// First Picker
}
else if (pickerView == pickerView2)
{
// First Picker
}
}
// tell the picker how many rows are available for a given component
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
if (pickerView == pickerView1)
{
// First Picker
return _myArray1.count;
}
else if (pickerView == pickerView2)
{
// Second Picker
return _myArray2.count;
}
// A third picker passed in somehow
return 0;
}
// tell the picker how many components it will have
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
if (pickerView == pickerView1)
{
// First Picker
return 1;
}
else if (pickerView == pickerView2)
{
// Second Picker
return 1;
}
// A third picker passed in somehow
return 0;
}
// tell the picker the title for a given component
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSString *title;
if (pickerView == pickerView1)
{
// First Picker
title = myArray1[row];
}
else if (pickerView == pickerView2)
{
// Second Picker
rtitle = myArray2[row];
}
return title;
}
// tell the picker the width of each row for a given component
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
if (pickerView == pickerView1)
{
// First Picker
return 300;
}
else if (pickerView == pickerView2)
{
// Second Picker
return 400;
}
// A third picker passed in somehow
return 0;
}