Objective-C를 처음 접하고 GNUstep 및 MinGW 환경에서 작업하고 있습니다. 이 코드를 컴파일하지만, 오류 데 :Objective-C on GNUstep AutoReleasePool 선언되지 않은 문제
#import "Foundation/Foundation.h"
@interface C : NSObject
{
float f;
}
- (void) gamerHell: (NSString *) name : (NSString *) lastName ;
@end
@implementation C
- (void) gamerHell: (NSString *) firstName : (NSString *) lastName {
NSLog(@"Welcome, %s %s",firstName,lastName);
}
@end
int main(int argc , const char * argv[]){
NSAutoReleasePool * pool = [[NSAutoReleasePool alloc] init];
C *ob = [[C alloc] init];
[ob gamerHell: @"SHAN" : @"UL HAQ"];
[ob release];
[pool drain];
return 0;
}
그것은 다음과 같이 컴파일 타임 오류가 제공됩니다 :
'NSAutoReleasePool' is undeclared (first use in this function)
나는이 오류를 극복하기 위해 어떻게해야합니까?
또한 Foundation 헤더는 큰 따옴표가 아닌 꺾쇠 괄호로로 가져와야합니다. –