カスタム MKAnnotationView を実装しましたが、ARC を有効にする前に正しく機能しました。initWithAnnotation メソッドは次のように実装されました。
- (id)initWithAnnotation:(id <MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
{
self.hasBuiltInDraggingSupport = [[MKAnnotationView class] instancesRespondToSelector:NSSelectorFromString(@"isDraggable")];
if (self.hasBuiltInDraggingSupport)
{
MKPinAnnotationView *pinAnnView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
self = (AnnotationView*)pinAnnView;
if (self)
[self performSelector:NSSelectorFromString(@"setDraggable:") withObject:[NSNumber numberWithBool:YES]];
}
self.canShowCallout = YES;
return self;
}
ARC を有効にした後、次の行で EXC_BAD_ACCESS を受け取り始めました。
self = (AnnotationView*)pinAnnView;
現在、私は何が起こるか分かりません。