期待“;”在声明清单的最后

时间:2013-04-16 04:54:17

标签: objective-c syntax

一直在考虑下面我的代码有什么问题。所有方法声明都由XCODE引用为错误。它说预期“;”在声明清单的末尾。我很感激你的帮助。谢谢:))

    @interface
    Budget : NSObject{

float exchangeRate;
double budget;
double exchangeTransaction;


- (void) createBudget: (double) aBudget withExchangeRate: (float) anExchangeRate;
- (void) spendDollarts: (double) dollars ;
- (void) changeForeignCurrency: (double) foreignCurrency ;
    }
    @end




    int main(int argc, const char * argv[])
    {
         NSLog(@"Run Without error");
         return 0;
    }

1 个答案:

答案 0 :(得分:4)

你的}位置错误。它需要在exchangeTransaction之后。例如:

@interface Budget : NSObject 
{
    float exchangeRate;
    double budget;
    double exchangeTransaction;
}

- (void)createBudget:(double)aBudget withExchangeRate:(float)anExchangeRate;
- (void)spendDollars:(double)dollars;
- (void)changeForeignCurrency:(double)foreignCurrency;

@end