나는 아이폰 Mapkit 응용 프로그램에 대한 MKAnnotationView의 서브 클래스를 만들려고 해요,하지만 어떤 이유로 갑자기이 오류가 발생하고있다 :MKAnnotationView의 하위 클래스에서이 오류의 원인은 무엇입니까?
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
이 보인다 코드 내 헤더와 주요 파일입니다 오류가 발생했습니다. 이 파일에 특별히 오류가 나타나지는 않지만 @implementation에서 @end로 .m 파일을 주석 처리하면 나타나지 않습니다. 그러나 @implementation 자체를 포함하지 않는 구현의 모든 것에 주석을 달면 여전히 나타납니다.
PhotoAnnotationView.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface PhotoAnnotationView : MKAnnotationView {
UIImageView *thumb;
}
@property (nonatomic, retain) IBOutlet UIImageView *thumb;
@end
PhotoAnnotationView.m
#import "PhotoAnnotationView.h"
@implementation PhotoAnnotationView
@synthesize thumb;
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect {
// Drawing code
}
- (void)dealloc {
[super dealloc];
}
@end
이것은 기본적으로 서브 클래스를 변경 New File... > Objective-C Class > Subclass of: UIView
통해 생성 엑스 코드와 동일한 코드이다.
Xcode 3.2.1 버전을 실행중인 Snow Leopard에 있습니다.
Xcode를 다시 설치해야합니까? 왜 내가이 오류를 받아야하는지 알지 못합니다. –