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 :D
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{
}