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 4248040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:11:45+00:00 2026-05-21T04:11:45+00:00

I have a dilemma, I have two UIPickerViews which show when two distinct views

  • 0

I have a dilemma, I have two UIPickerViews which “show” when two distinct views load. I started with one UIPickerView and was able to get that up and running by loading the array and all the other UIPickerView actions within the ViewController.

I thought it would be as simple as copy/pasting the same methods for the new UIPickerView, but just changing the variable names, also within the same UIViewController.

Problem is – both UIPickerView are showing the same data set in the drop down ? Am I simply missing something obvious here?

Updated below

I did that for all four methods below and now that app crashes once the “next” view is loaded? Does this look right?

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView 

- (NSInteger)thePickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component

- (NSString *)thePickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component

- (void)thePickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
  • 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-21T04:11:46+00:00Added an answer on May 21, 2026 at 4:11 am

    Yeah you are, you have to use the UIPickerView argument to determine WHICH picker view is actually asking for data – since you have set both pickers to the same data source.

    -(void)numberOfComponentInPickerView:(UIPickerView*)thePickerView {
        if(thePickerView == firstPickerView) {
           // return number of components in first picker    
        } else if(thePickerView == secondPickerView) {    
           // return number of components in second picker    
        } else {
           assert(NO);
        }
    }
    
    // repeat for all other delegate / datasource methods
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my dilemma: I have two types of routes which are semantically very different,
I have a little dilemma that maybe you can help me sort out. I've
Okay, my dilemma is this. I have an admin page that I use to
I have two dropdown lists, one containing a list of countries and one for
I have a conceptual Python design dilemma. Say I have a City class, which
I have a script that appends some rows to a table. One of the
Here's my dilemma - I have a two-column list of elements (styled <div> s)
I have a method where I am passing in two object, which have the
I have a fairly complicated function that takes several double values that represent two
I have a little dilemma on how to set up my visual studio builds

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.