Objective c 注释调用上的详细视图附件按钮未显示

Objective c 注释调用上的详细视图附件按钮未显示,objective-c,ios,Objective C,Ios,我是iOS开发的初学者,对堆栈溢出比较陌生。地图上未显示标注调用上的详细视图附件按钮 PSPlaceMark *addAnnotation = [[PSPlaceMark alloc] initWithCoordinate:mapView.userLocation.location.coordinate] ; [addAnnotation setTitle:@"anshuk"]; [addAnnotation setSubTitle:@"The pin subtitle goes her

我是iOS开发的初学者,对堆栈溢出比较陌生。地图上未显示标注调用上的详细视图附件按钮

PSPlaceMark *addAnnotation = [[PSPlaceMark alloc] initWithCoordinate:mapView.userLocation.location.coordinate] ;  
[addAnnotation setTitle:@"anshuk"];  
[addAnnotation setSubTitle:@"The pin subtitle goes here"]; 
MKPinAnnotationView *newAnnotation = [[[MKPinAnnotationView alloc] initWithAnnotation:addAnnotation reuseIdentifier:[addAnnotation title]] autorelease];
newAnnotation.pinColor = MKPinAnnotationColorPurple;
newAnnotation.animatesDrop = YES; 
newAnnotation.canShowCallout = YES;
newAnnotation.userInteractionEnabled = YES;
//newAnnotation.enabled = YES;

// Add a detail disclosure button to the callout.
UIButton* rightButton = [UIButton buttonWithType: UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(self) forControlEvents:UIControlEventTouchUpInside];
newAnnotation.rightCalloutAccessoryView = rightButton;

这是代码,请告诉我我错在哪里。

也许您只是没有在上面显示它,但您还没有对MKPinAnnotationView执行任何操作。另一条评论:@selector(self)-->是您的函数
-(void)self?那么您可能正在覆盖某些内容。尝试@selector(pinClicked)和
-(void)pinClicked取而代之。我已对(自我)部分进行了更改。。这不是现在的问题。。未显示详细信息披露按钮。它只显示默认的标注,而不显示按钮。而我的newAnnotation是initwithannotation和newAnnotation.rightCalloutAccessoryView=rightButton;也许是个愚蠢的问题,但您确定正在显示newAnnotation吗?