0

テキストフィールドから値を取得し、ラベルの値を掛けて平均を計算しようとしています。

int grade1 = [[self.Cw1Grade text]intValue];
    int grade1weight = self.weight1.text.intValue;

    int a1grade = grade1 / 100; 
    int a1total = a1grade * grade1weight;
    NSString *grade1total = [NSString stringWithFormat:@"%d", a1total];
    [self.averageLabel setText:grade1total];

お時間をいただきありがとうございます

4

1 に答える 1