2011-04-26 6 views
0

안녕하세요. 드래그 가능한 핀을 만들려고하는데, 핀을 움직이려고하면 움직이지 않습니다.지도 만 이동하고 핀은 smae 위치에 머물러 있습니다. 지도 뷰의 드래그 가능 핀

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ 

    MKPinAnnotationView *test=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"parkingloc"]; 
    if([annotation title][email protected]"Parked Location") 
    { 
//  
     [test setUserInteractionEnabled:YES]; 
     [test setCanShowCallout:YES]; 
     [test setDraggable:YES]; 
     return test;  
    } 
    [ 
    return test;  
} 

또한 내 사용자 지정 annonation 클래스는 왜 이러한

- (NSString *)subtitle{ 
    return @"Put some text here"; 
} 
- (NSString *)title{ 
    return @"Parked Location"; 
} 

-(id)initWithCoordinate:(CLLocationCoordinate2D) c{ 

    coordinate=c; 
    NSLog(@"%f,%f",c.latitude,c.longitude); 
    return self; 
} 
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate 
{ 
    coordinate=newCoordinate; 
} 

하지만이 작동하지 않습니다처럼 ...? |

없는 경우 | 제목 :

+0

해결책을 찾았습니까? – Melvin

+0

작성한 후 readwrite 속성에 대한 답변을 참조하십시오. http://stackoverflow.com/questions/5061976/mapview-annotation-not-dragging – Melvin

답변

1

이 오래지만 넣다 사람이 미래에 관심 MKPinAnnotationView에 대해 설정되어 있으면 끌기가 작동하지 않습니다.

관련 문제