-2
我只是新的Objective-C,以及我還沒有進入可可觸摸庫,但我嘗試遵循Objective-C書,並編寫一些類獲得更多的練習。xcode4不完整的實現
我在執行語句中有一個錯誤,你能告訴我哪個部分我犯了錯誤嗎?
#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
你的問題太模糊 – keyser
Xcode說我,第2行不完整的實現,這表明@implementation構建 –
在問題中包括這樣的重要信息。 – keyser