大家好我試圖改變註釋的圖像時,用戶走在下面的代碼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