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

  • Home
  • SEARCH
  • 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 8681035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:24:04+00:00 2026-06-12T21:24:04+00:00

My app is a converter with a multicomponent picker wheel. It is made for

  • 0

My app is a converter with a multicomponent picker wheel. It is made for converting some variables. The numbers you can see is just for testing, nothing important really.

- (void)viewDidLoad
{
  [super viewDidLoad];
  _convertFrom = @[@"One (1)", @"Two (2)",
  @"Three (3)", @"Four (4)", @"Five (5)"];

  _convertRates = @[ @1.0f, @2.0f, @3.0f,
  @4.0f, @5.0f];

  _convertTo = @[@"One (1)", @"Two (2)",
  @"Three (3)", @"Four (4)", @"Five (5)"];

_convertRates = @[ @1.0f, @2.0f, @3.0f,
@4.0f, @5.0f];

}

I have a small problem with the numbers that is displayed when i test the app in the iOS 6 simulator. As you can see here:

Screenshot

https://i.stack.imgur.com/Rn8Hg.jpg

When i try to go down the list, the numbers change. But the value of them does not.
If someone has got the time to check it out and maybe find a solution it would be very helpful:)

here is the rest of the code that might be important in this case:

#pragma mark -
#pragma mark PickerView DataSource

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

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:    (NSInteger)component
{
if (component == 0)  {
    return [_convertFrom count];
}
return [_convertTo count];
}


- (NSString *) pickerView: (UIPickerView *)pickerView
          titleForRow:(NSInteger)row
         forComponent:(NSInteger)component
{
if (component == 0) {
    return [_convertFrom objectAtIndex:[pickerView selectedRowInComponent:0]];
}
return [_convertTo objectAtIndex:[pickerView selectedRowInComponent:1]];
}




#pragma mark -
#pragma mark PickerView Delegate
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
  inComponent:(NSInteger)component
{
    float convertFrom = [[_convertRates objectAtIndex:[pickerView  selectedRowInComponent:0]] floatValue];
float convertTo = [[_convertRates objectAtIndex:[pickerView selectedRowInComponent:1]] floatValue];
float input = [dollarText.text floatValue];
float to = convertTo;
float from = convertFrom;
float dollars = input;
float result = to * from * dollars;
float mtpaTilMtpaFloat = dollars * 1;
NSString *resultString = [[NSString alloc] initWithFormat:
                          @"result = %.2f *  %.2f = %.2f", from, to, result];
resultLabel.text = resultString;

NSString *mtpaTilmtpa = [[NSString alloc ] initWithFormat:
                           @" %.2f MTPA = %.2f MTPA", dollars, mtpaTilMtpaFloat];



if (from == 1, to == 1) { resultLabel.text = mtpaTilmtpa;
}

And of course, tell me if I need to display more of the code so you can understand it. its my first time using this website btw:)

  • 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-12T21:24:05+00:00Added an answer on June 12, 2026 at 9:24 pm

    don’t use selectedRowInComponent. You don’t wan’t to display the value that is selected in all your rows. Just use row

    - (NSString *) pickerView: (UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
    {
        if (component == 0) {
            return [_convertFrom objectAtIndex:row];
        }
        return [_convertTo objectAtIndex:row];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my wicket app, I want to use my own converter for some textfields
I'm trying to convert my app to ARC and the converter is throwing up
I'm porting a app to FreePasal/Lazarus & found that their form converter is not
I'm using markdown editor in my app. $(document).ready(function () { var converter = Markdown.getSanitizingConverter();
i have just converted an app i was making from a navigation controller app
I have a simple iPhone app which accesses some remote data on start-up then
I'm a bit confused, I set up my app as a simple converter but
I am creating a currency converter app. I know that the value of currencies
I am working on a simple currency converter app and I want to grab
Recently I published my first Android App on the Market Place (Trophy-to-Gamerscore Converter). It's

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.