大家好我试图改变注释的图像时,用户走在下面的代码MapView的注释调整
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
for (int i = 0; i < [_annotationArray count]; i++)
{
//MKAnnotation xxx = [_annotationArray objectAtIndex:i];
Shadows* shadowObj2 = [_shadowArray objectAtIndex:i];
NSLog(@"%@",_shadowArray);
CLLocationCoordinate2D location3;
location3.latitude = [shadowObj2.position_x floatValue];
location3.longitude = [shadowObj2.position_y floatValue];
CLLocation* locationold = [[CLLocation alloc] initWithLatitude:location3.latitude longitude:location3.longitude];
CLLocationDistance kilometers = [newLocation distanceFromLocation:locationold];
//temp = [kilometers intValue];
if (kilometers > 50 && kilometers <100)
{
MKAnnotationView* newA = [[MKAnnotationView alloc] initWithAnnotation:[_annotationArray objectAtIndex:i] reuseIdentifier:@"annotation1"];
newA.image = [UIImage imageNamed:@"shadowS.png"];
newA.canShowCallout = YES;
}
[locationold release];
//[shadowObj2 release];
}
}
,但我无法改变标注图像,请告诉我为什么我不能够做到这一点
但我的问题是不同的 – 2011-03-25 09:38:22