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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:41:24+00:00 2026-06-10T15:41:24+00:00

Im very new to xcode and i have a question to my first app.

  • 0

Im very new to xcode and i have a question to my first app.
I have a UIPickerView with 2 components filled with NSMutableArray in my App. If the first component is changed, the second components Array got cleared and Filled with new Values.
Now i have to detect the selected row in first component and the selected row in second component, to load an local HTML page in UIWebView.
Ill tried it with an if loop, but i dont understand how to detect all selected rows on the 2 components.
Heres a litte snippet of my sourcecode:

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
NSLog(@"the %d row was selected in the %d component", row, component);
if ((component == 0) && (row ==0)){
     [rightPickerArray removeAllObjects];
     [rightPickerArray addObject:@"5.0"];
     [rightPickerArray addObject:@"5.1"];
     [pickerView reloadAllComponents];
}
if ((component == 0) && (row ==1)){
    [rightPickerArray removeAllObjects];
    [rightPickerArray addObject:@"1"];
    [rightPickerArray addObject:@"2"];
    [pickerView reloadAllComponents];
}

if ((component ==1) && (row ==0)){
    NSString *fileString = [[NSBundle mainBundle] pathForResource:@"index" ofType: @"html"];

    NSString *newHTMLString = [[NSString alloc] initWithContentsOfFile: fileString encoding: NSASCIIStringEncoding error: NULL];

    NSURL *newURL = [[NSURL alloc] initFileURLWithPath: fileString];

    [myWebView loadHTMLString: newHTMLString baseURL: newURL];
}
  • 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-06-10T15:41:26+00:00Added an answer on June 10, 2026 at 3:41 pm

    UIPickerView has a “selectedRowInComponent:” method that’s supposed to help with this. Check this out.

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

Sidebar

Related Questions

I am very new to XCode and objective-c. This question may have been answered
I am new to xcode and making my first iPhone app. I have a
I'm new to Xcode. This is probably a very simple question to you, but
I am very new to xcode & Objective-C (having come from PHP) i have
I am new to iphone and xcode. This may be a very simple question
Im very new to game development on the iPhone... And I have a question:
I am new to iphone so I have a very simple question. I am
Hello all! I am very new to xcode and objective-c but I have been
So I am very new to xcode and iOS and just getting use to
I am very new to the Xcode environment. I would like to compile some

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.