내 앱에서 최근에 사용 된 "MapKitDragAndDrop 3"패키지 (http://github.com/digdog/MapKitDragAndDrop)를 다운로드했습니다. 데모 프로젝트는 원활하게 진행됩니다.Iphone Drag'n'Drop MapKit이 "인스턴스로 전송 된 인식 할 수없는 선택기"예외를 생성합니다.
DDAnnotation.h + m 및 DDAnnotationView.h + m 파일은 모두 그대로 가져 왔습니다. 클래스를 호출하는 방법도 복사/붙여 넣기되었습니다.
DDAnnotation *annotation = [[[DDAnnotation alloc] initWithCoordinate:theCoordinate addressDictionary:nil] autorelease];
annotation.title = @"Drag to Move Pin";
annotation.subtitle = [NSString stringWithFormat:@"%f %f", annotation.coordinate.latitude, annotation.coordinate.longitude];
[self.mapView addAnnotation:annotation];
첫 번째 실행에서 "인스턴스로 전송 된 인식 할 수없는 선택기"예외가 발생했습니다. 디버거는 DDAnnotation 클래스에서 setCoordinate 메소드를 구현할 것을 제안합니다. 아직 데모 파일에는 @synthesize 나 메소드 구현이 없습니다.
DDAnnotation.m :
#import "DDAnnotation.h"
@implementation DDAnnotation
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate addressDictionary:(NSDictionary *)addressDictionary {
if ((self = [super initWithCoordinate:coordinate addressDictionary:addressDictionary])) {
// NOTE: self.coordinate is now different from super.coordinate, since we re-declare this property in header,
// self.coordinate and super.coordinate don't share same ivar anymore.
self.coordinate = coordinate; // CHECKPOINT
}
return self;
}
@end
는 디버거에서 CHECKPOINT에 DDAnnotation.h에 떨어지는 DDAnnotation.m을 추적시. 내 응용 프로그램에서는 그렇지 않습니다.
나는 그 실수가 어리 석다는 것을 정말로 기대하지만, 나는 어디에서 봐야할지 모른다. 감사.
자막을 설정할 때 오류가 줄에 표시되는 느낌이 들었습니다. 주석의 좌표 변수에 액세스하려고하는 경우입니다. – tadejsv
DNK, 프로젝트를 다시 가져 오십시오. 문제가 발생한 프로젝트 설정 오류가 수정되었습니다. – digdog