を使用するときに問題が発生MKAnnotation
しました。MapView に注釈を追加したいので、という名前のクラスを作成しAdoptingAnAnnotation
ます。.h
ファイルは #import #import に従います
@interface AdoptingAnAnnotation: NSObject {
}
@synthesize latitude;
@synthesize longitude;
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
- (NSString *) title;
- (NSString *) subtitle;
@end
および.mファイルは次のとおりです
#import "AdoptingAnAnnotation.h"
@implementation AdoptingAnAnnotation
@synthesize latitude;
@synthesize longitude;
- (id) initWithLatitude:(CLLocationDegrees) lat longitude:(CLLocationDegrees) lng {
latitude = lat;
longitude = lng;
return self;
}
- (CLLocationCoordinate2D) coordinate {
CLLocationCoordinate2D coord = {self.latitude, self.longitude};
return coord;
}
- (NSString *) title {
return @"217 2nd St";
}
- (NSString *) subtitle {
return @"San Francisco CA 94105";
}
@end
illegal interface qualifier
Is my syntax error or other error about the MKAnnotation
?のようなエラー メッセージを取得します。