さて、ここの人たちは私の問題です。私は電子学生のためにuipickerviewを使って抵抗計算機を使っていますが、「DidSelectRow」のメソッドを構成する方法がわかりません。
この抵抗計算機のアイデアは、ユーザーが抵抗の色(行)を選択すると、uipickerviewが色に対応する操作を行い、結果をUILABELにスローすることです。
抵抗値を計算するには、色1の線の値と色2の線の値を合わせて、色3の線の値を掛けます。
行に値を割り当て、後でそれらを結合し、次に乗算して最後にUILABELをスローする方法がわかりません。
誰か助けてください!! そして、私は私のアプリのクレジットを入れます!お願いします:D
これは私の.hです
#import <UIKit/UIKit.h>
@interface Resistenciacalc : UIViewController
<UIPickerViewDelegate,UIPickerViewDataSource>
@property (strong, nonatomic) IBOutlet UIPickerView *ColorPicker;
@property (strong, nonatomic) NSArray*ColorData;
これは私の.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{
}