我有一个处理mapkit和注释的应用程序,它工作正常,现在我想添加DRAGGABLE注释。我该怎么做才能添加这个功能?这是我的annotation.m类:
//
// MapDemoAnnotation.m
// MapDemo
//
// Created by Riccardo Queri on 12/01/11.
// Copyright 2011 Unipg. All rights reserved.
//
#import "MapAppAnnotation.h"
@implementation MapAppAnnotation
@synthesize coordinate=_coordinate;
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate{
self = [super init];
if (self != nil) {
_coordinate = coordinate;
}
return self;
}
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate{
}
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate andID:(NSUInteger)pinID{
self = [super init];
if (self != nil) {
_coordinate = coordinate;
_pinID = pinID;
}
return self;
}
- (NSString *)title {
return [NSString stringWithFormat:@"Boa %u", _pinID];
}
- (NSString *)subtitle {
return [NSString stringWithFormat:@"%.4f, %.4f", _coordinate.latitude, _coordinate.longitude];
}
@end
答案 0 :(得分:0)
MKAnnotationView
有draggable
属性.....你可以使用它。你可以根据自己的需要进行设置。
感谢