I am just new on Objective-C , well i have not get in to cocoa touch library yet, but i am try to follow Objective-C book and write some classes for get in more practice .
I have a error in Implementation statement , could you tell me which part that i made mistake ?
#import "getterSetter.h"
@implementation getterSetter
@synthesize airportName;
- (char) print : (char) name
{
return name;
}
- (int) zip : (int) zipair
{
return zipair;
}
@end
int main(int argc,char *argv[])
{
char *airportName;
getterSetter *airport = [[getterSetter alloc]init];
NSLog(@"Please enter the airport name:\n");
scanf("%c",&airportName);
NSLog(@"Please enter the airport name:\n");
scanf("%c",&airportName);
NSLog(@"Your Airport Name is :\n");
[airport print:*airportName];
}
#import <Foundation/Foundation.h>
@interface getterSetter : NSObject
{
char *airportName;
int zipCode;
char *airportCityName;
}
- (char) print : (char) name;
- (int) zip;
@property char *airportName;
@end
In getterSetter.h, you declare a method
but in the .m file you implement
That is a different method, therefore the compiler complains about the missing implementation of
- (int) zip.