Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

geekindisguise

macrumors 6502
Original poster
Jul 22, 2008
297
0
Oklahoma
I have followed this tutorial several times trying to figure out what was making it come up with the parse error, but I just keep having the same errors.

On the Converter.m file there are two errors.

Code:
#import "Converter.h"
 
@implementation Converter
@synthesize sourceCurrencyAmount, rate;
 
- (float)convertCurrency {
    return self.sourceCurrencyAmount * self.rate;
}
 
@end

The first error: parse error before 'AT_NAME' token
Code:
@implementation Converter

Then the second error: parse error before '{' token
Code:
- (float)convertCurrency {

Then one more error on the Converter.h file

Code:
#import <Cocoa/Cocoa.h>
@interface Converter : NSObject {
    float sourceCurrencyAmount, rate;
}
@property(readwrite) float sourceCurrencyAmount, rate;

- (float)convertCurrency;

The error: parse error before '@' token
Code:
@property(readwrite) float sourceCurrencyAmount, rate;

I copied the codes straight from Apples Tutorial.
Also, I am running OS X 10.4.11 and Xcode 2.5

All help is greatly appreciated.

And if you know of any great online tutorials or anything that would help me learn Cocoa, that would be great. Coming from being a web developer, I thought learning Cocoa would be easy. Lots of it is similar to PHP, but its still very confusing for me. Thanks! :apple:
 
I suggest you post the **complete** code, especially your Converter.h file. I think you will find someone will be able to figure it out.
 
I suggest you post the **complete** code, especially your Converter.h file. I think you will find someone will be able to figure it out.

I did post the Complete code.
That is all that is in the converter.h and converter.m files.
 
really? i never knew this... it's strange, though, isn't it? hasn't Objective-C 2.0 been around since 2007ish? why is it not supported on tiger?

It was added for Leopard. An incentive for developers to upgrade, I guess. Annoying, because it means things like properties, fast enumeration, and the garbage collector break the programs for Tiger.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.