2
MKMapView显示mapView中心的针脚,我想将针脚位置放在中心上方。我怎么做?如何在MKMapView中设置PlaceMark位置?
这里是我的代码
- (void) location
{
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = 0.1162;
span.longitudeDelta = 0.1160;
CLLocationCoordinate2D location;
location.latitude = 65.494806;
location.longitude = -23.577569;
region.span=span;
region.center=location;
PlaceMark *add_Annotation = [[[PlaceMark alloc] initWithCoordinate:location] autorelease];
[add_Annotation setTitle:@"myTitle"];
[add_Annotation setSubTitle:@"myAddress"];
[mapView addAnnotation:add_Annotation];
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
}
我明白了!但是我的代码出错了。错误消息:体系结构i386的未定义符号: “_CLLocationCoordinate2DMake”,引用来自: – HardCode
将Core Location框架添加到项目中。 – Anna
谢谢,工作正常! – HardCode