'PlaceMark'没有可见的@interface声明选择器'initWithTitle:Location:'

时间:2014-05-27 23:45:42

标签: ios objective-c mapkit

我正在尝试简单地更改地图上图钉的图像,但由于此错误,我无法创建注释。

Theres my“PlaceMark.h”:

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>

@interface PlaceMark : NSObject <MKAnnotation>

@property (nonatomic, readonly) CLLocationCoordinate2D coordenada;
@property (copy, nonatomic) NSString *titulo;

-(id)initWithTitle:(NSString *)novoTitulo Location:(CLLocationCoordinate2D)location;
-(MKAnnotationView *)annotationView;

@end

我的“PlaceMark.m”:

#import "PlaceMark.h"

@implementation PlaceMark
@synthesize coordenada;
@synthesize titulo;

-(id)initWithTitle:(NSString *)novoTitulo Location:(CLLocationCoordinate2D)location{
    self=[super init];
    if(self){
        titulo=novoTitulo;
        coordenada=location;
    }
    return self;
}

-(MKAnnotationView *)annotationView{
    MKAnnotationView *annotationView=[[MKAnnotationView alloc] initWithAnnotation:self         reuseIdentifier:@"ponto"];

    annotationView.enabled=true;
    annotationView.canShowCallout=true;
    annotationView.image=[UIImage imageNamed:@"placa.png"];
    return annotationView;
}
@end

编辑: 在我实例化标记的地方:

//heres the error
PlaceMark *ponto = [[PlaceMark alloc] initWithTitle:@"Ponto" Location:coordinate];
[_mapKit addAnnotation:ponto];

已经尝试过清洁和重建

怎么了? 谢谢:))

0 个答案:

没有答案