iPhone Mapkit アプリ用に MKAnnotationView のサブクラスを作成しようとしていますが、何らかの理由で突然次のエラーが発生します。
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
これらは、エラーを引き起こしていると思われるコードのヘッダー ファイルとメイン ファイルです。このファイルに特にエラーは表示されませんが、.m ファイルを @implementation から @end までコメント アウトすると表示されません。ただし、 @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
これは基本的に、XcodeNew File... > Objective-C Class > Subclass of: UIView
がサブクラスを変更して作成したコードと同じです。
Xcode のバージョン 3.2.1 を実行している Snow Leopard を使用しています。