Objective-C で単純なピタゴラス電卓を作成しようとしていますが、常に次のエラー メッセージが表示されます。
これは私のクラスです:
@implementation PythagorasCalc
- (double)calculatePythagorasValue
{
return sqrt(A*A+B*B);
}
//Access Code
-(int)A{
return A;
}
-(void)setA: (int)value {
if(A != value) {
A = value;
}
}
-(int)B{
return B;
}
-(void)setB: (int)value {
if(B != value) {
B = value;
}
}
-(int)C{
return C;
}
-(void)setC: (int)value {
if(C != value) {
C = value;
}
}
@end
これは私の AppDelegate です:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
calculator = [[PythagorasCalc alloc] init];
}
- (IBAction)calculateClicked:(id)sender
{
double A = _ATextField.doubleValue;
double B = _BTextField.doubleValue;
calculator.A = A;
calculator.B = B;
double C = [calculator calculatePythagorasValue]
}
@end;
}
助けてください!!