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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:38:41+00:00 2026-06-05T02:38:41+00:00

Ok, guys here is my problem, I’m doing a Resistor calculator for electronic students

  • 0

Ok, guys here is my problem, I’m doing a Resistor calculator for electronic students with a uipickerview, but i dont have any idea how to configurate the method of “DidSelectRow”.

The idea of this resistor calculator is when the user select the colors (rows) of her resistor, the uipickerview make the operations corresponding to the colors and throw the result in a UILABEL.

For calculate the resistor value, together the value of the line of color 1 to value of the line of color 2 then multiply with the value of the line of color 3, something like that.

This is the image of the values to calculate the resistor value

I dont know how to assing values to the rows, to join them after and then multiply and finally throw in a UILABEL.

Someone help me please!! and i´ll put in the credits of my app! Pleasee 😀

This is my .h

#import <UIKit/UIKit.h>

@interface Resistenciacalc : UIViewController
<UIPickerViewDelegate,UIPickerViewDataSource>


@property (strong, nonatomic) IBOutlet UIPickerView *ColorPicker;

@property (strong, nonatomic) NSArray*ColorData;

This is my .m

#import "Resistenciacalc.h"

@interface Resistenciacalc ()

@end

@implementation Resistenciacalc
@synthesize ColorData = _ColorData;
@synthesize ColorPicker;

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    _ColorData = [[NSArray alloc] initWithObjects:@"Negro",@"Marron",@"Rojo",@"Naranja",@"Amarillo",@"Verde",@"Azul",@"Violeta", nil];
}

#pragma mark - UIPickerview Methods

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

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return _ColorData.count;
}

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

/*- (void)pickerView:(UIPickerView *)pickerView 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-06-05T02:38:43+00:00Added an answer on June 5, 2026 at 2:38 am

    If you put this line: NSLog(@”Row is:%d Component is:%d”,row,component); in the pickerView:didSelectRow:inComponent method, you will see that it gives you the row and component (column). The row number will give you the value for that color, since, for instance, “Negro” is in row 0 and black represents 0 in the resistor color scheme. The column number will tell you what value to use as the multiplier to get your resistor value. Something like this should be close to what you need. I’ve declared properties, firstDigit and secondDigit (as ints) and multiplier (as double) in the controller .h file. I added a button that does the calculation after the user has picked the colors:

    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    
        switch (component) {
            case 0:
                self.firstDigit = row ;
                break;
            case 1:
                self.secondDigit = row ;
                break;
            case 2:
                self.multiplier = pow(10,row);
                break;
    
            default:
                break;
        }
    }
    
    
    -(IBAction)calculateValue:(id)sender {
        int value = (self.firstDigit *10 + self.secondDigit)* multiplier;
        NSLog(@"%d Ohms",value);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys here is the problem i am facing i have a User class
Guys, sorry for asking basic question, i have a problem here where I have
maybe you guys can help me i have a little problem here: I have
Helly guys, first here the jsfiddle example and here my problem. I have 3
HI Guys, Here I am having problem that How can I post an image
Hey guys I have a little issue here. I have a panel where I
Hey guys, here is my problem. I am writing a Drupal module. A user
I got a little problem here guys. I'm trying to implement the following scenario:
I have a problem here and it seems that my brain has just left
Hi guys, I am making some iPhone graph thingy. Here is my problem. I

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.