Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3957288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:28:18+00:00 2026-05-20T02:28:18+00:00

I decided to use a UIPickerView to simulate a kind of dropdown menu. My

  • 0

I decided to use a UIPickerView to simulate a kind of dropdown menu.
My problem is, that i want to use more than one UIPickerView.
How do i manage to set up a second UIPickerView?
Adding a new UIViewController? or how does it work?
Adding a second span won’t be enough, i need up to 3 more UIPickerViews.
Thanks in advance 🙂

Code:

   -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
        return 1;
    }

    -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
        return [pickerarray count];
    }

    -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
        return [pickerarray objectAtIndex:row];
    }

    -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    }

- (void)viewDidLoad {

pickerarray = [[NSMutableArray alloc] init];
[pickerarray addObject:@"Hamburg"];
[pickerarray addObject:@"Berlin"];
[pickerarray addObject:@"München"];
[pickerarray addObject:@"Bonn"];

pickerarray2 = [[NSMutableArray alloc] init];
[pickerarray2 addObject:@"Hambburg"];
[pickerarray2 addObject:@"Berelin"];
[pickerarray2 addObject:@"Müneechen"];
[pickerarray2 addObject:@"Boneen"];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:28:19+00:00Added an answer on May 20, 2026 at 2:28 am
    1. Add all of them into your view.
    2. Set them as hidden.
    3. Set unique tags for each of them.
    4. Add buttons that “reveal them”.
    5. Implement delegate methods that manage values depending on picker view tag.

    Code update:

    // put this before view controllers @implementation
    enum {
      MyFirstPickerViewTag = 1,
      MySecondPickerViewTag
    } MyPickerViewTags; // fix for warning
    
    // assign tags 1 and 2 respectively to your picker views in IB
    // here's one of delegate methods
    
    -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
        switch(pickerView.tag) {
            case MyFirstPickerViewTag: {
                return 2;
            }
            case MySecondPickerViewTag: {
                return 3;
            }
        }
        return 1; //  component by default
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've decided that I don't want to ever use UIPickerView again... it's completely inflexible
I've decided to use this.variableName when referring to string/int etc.. fields. Would that include
On one of our sites we decided to use lighboxes in 2 instances. I
I looked around and decided to use a CSS approach rather than rely on
We decided to use mongodb for some web application (instead of mysql) but want
I have decided to use postgre instead of sql server. My only problem is
One of my team members decided to use autofac on one of our services
I decided to use jquery to create the duplicate of dropdown menus instead of
I decided to use jquery-ui Autocomplete Combobox, but until now I didn't noticed that
For a project I decided to use Dynamic Data Display to generate charts (more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.