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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:35:47+00:00 2026-05-19T03:35:47+00:00

Let me try to explain what I have on view and what’s I’m trying

  • 0

Let me try to explain what I have on view and what’s I’m trying to accomplish. I have a viewcontroller with two UIPickerView's in it. Each UIPickerView is connected via IFB. Everything works great but I’m trying to reload the data on one picker depending on which selection of another picker.

.m file

- (void)viewDidLoad
{
[super viewDidLoad];
pickerViewArray = [[NSMutableArray alloc] init];
[pickerViewArray addObject:@"Name 1"];
[pickerViewArray addObject:@"Name 2"];
[pickerViewArray addObject:@"Name 3"];
[pickerViewArray addObject:@"Name 4"];
[pickerViewArray addObject:@"Name 5"];

pickerViewArray2 = [[NSMutableArray alloc] init];
[pickerViewArray2 addObject:@"Phone 1"];
[pickerViewArray2 addObject:@"Phone 2"];
[pickerViewArray2 addObject:@"Phone 3"];
[pickerViewArray2 addObject:@"Phone 4"];
[pickerViewArray2 addObject:@"Phone 5"];
}
}

- (void)pickerView:(UIPickerView *)aPickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
  if([[pickerViewArray2 objectAtIndex:row] isEqual:@"Phone 2"]){
    [picker2 reload];
  }
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)aPickerView {

    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)aPickerView numberOfRowsInComponent:(NSInteger)component {

    return [pickerViewArray count];

}

- (NSString *)pickerView:(UIPickerView *)aPickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

    return [pickerViewArray objectAtIndex:row];
}

Edit: to fix the problem I was having just add the array to each aPickerView i.e. titleForRow etc.

  • 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-19T03:35:47+00:00Added an answer on May 19, 2026 at 3:35 am

    The reload method does just that – reloads the existing data. You need to move the logic that you have in viewDidLoad into titleForRow and numberOfRowsInComponent so that once the first picker has been actioned, the correct data can be returned. At the moment you load something different into pickerViewArray2 only at viewDidLoad, and that won’t be re-run by your reload method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me try to explain My case, I have two table and each of
That question makes no sense... so let me try to explain. I have two
(tl;dr at the bottom) Let me try to explain what I'm trying to accomplish:
Let me try to explain the scenario. I have two tables A (Columns -
Let me try to explain what I'm trying to accomplish. I want to make
Ok, let me try to clearly explain what I'm attempting to accomplish here. Basically,
Let me try to explain this the best I can. I have a component
Let me try to explain what I need. I have a server that is
This title may seem strange, so let me try to explain what I'm trying
Let me try and explain the scenario: I have a form with multiple items

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.