I'm at wits ends trying to fix this. I've been googling for the last hour about this.
Any ideas?
The error is up in the @interface for Car...
Any ideas?
The error is up in the @interface for Car...
Code:
#import <Foundation/Foundation.h>
//classes
@interface Car : NSObject
{
-(NSString *) carModel;
-(NSString *) ownerName;
-int gasAmount;
}
-(void) setModel: (NSString *) m;
-(void) setOwner: (NSString *) o;
-(void) setGas: (int) g;
@end
@implementation Car
{
-(void) setModel: (NSString *) m
{
carModel = m;
}
-(void) setOwner: (NSString *) o
{
ownerName = o;
}
-(void) setGas: g
{
gasAmount = g;
}
@end
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Car *myCar = [[Car alloc] init];
[myCar setModel:@"Ford F150"];
[myCar setOwner:@"Anthony Crognale"];
[myCar setGas: 1];
NSLog([myCar carModel]);
NSLog([myCar ownerName]);
NSLog([myCar gasAmount]);
// insert code here...
[pool drain];
return 0;
}