-1
我需要幫助。如何在if語句中使用已被稱爲條件的IBAction方法。 XCODE
-(IBAction) equalsPressed:(id)sender{
if(((IBAction) dividePressed) = YES){
int equals = labelsNumber.text.intValue;
labelsNumber.text = @"";
int ans = divide/equals;
NSString *answer = [NSString stringWithFormat:@"%d", ans];
labelsNumber.text = answer;
我正在建立一個計算器,錯誤是「Expected Expression」。
請幫忙
'dividePressed'是什麼?這是一種方法嗎?一個實例變量? – rmaddy 2013-02-27 01:45:37
除了下面的優秀答案,我推薦[這個SO線程](http://stackoverflow.com/q/1643007/620197)以更好地理解'IBAction'是什麼。 – 2013-02-27 01:52:05