调用单击在iOS中的iPhone模拟器4s中不起作用

调用单击在iOS中的iPhone模拟器4s中不起作用,ios,iphone,dictionary,annotations,callout,Ios,Iphone,Dictionary,Annotations,Callout,我已经在当前纬度和经度上创建了注释视图,并使用自定义注释在其上使用图像。它工作正常,并使用Apple示例MapCallout创建自定义标注 [使用标记部分设置图像并单击紫色pin符号中的部分]但我的单击在iPhone simulator 5和更高版本中运行良好,但在iPhone 4S simulator中单击不工作超过标注,我尝试了多种方法,但没有成功。有谁能建议我为iPhone4S设置了哪些内容以运行点击调用 在视图注释中,我的代码如下所示 - (MKAnnotationView *)mapV

我已经在当前纬度和经度上创建了注释视图,并使用自定义注释在其上使用图像。它工作正常,并使用Apple示例MapCallout创建自定义标注 [使用标记部分设置图像并单击紫色pin符号中的部分]但我的单击在iPhone simulator 5和更高版本中运行良好,但在iPhone 4S simulator中单击不工作超过标注,我尝试了多种方法,但没有成功。有谁能建议我为iPhone4S设置了哪些内容以运行点击调用

在视图注释中,我的代码如下所示

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    MKAnnotationView *returnedAnnotationView = nil;

    if([annotation isKindOfClass:[MAKRSampleAnnotation class]])
    {
        returnedAnnotationView = [MAKRSampleAnnotation createViewAnnotationForMapView:self.mapView annotation:annotation];

        // provide the annotation view's image
        returnedAnnotationView.image = [UIImage imageNamed:@"map_pointer_yellow.png"];

        // trying to click using this in 4s , working in iPhone 5 and later
        UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        [rightButton addTarget:nil action:nil forControlEvents:UIControlEventTouchUpInside];
        ((MKPinAnnotationView *)returnedAnnotationView).rightCalloutAccessoryView = rightButton;

        return returnedAnnotationView;
    }

    return returnedAnnotationView;
}
-(MKAnnotationView*)地图视图:(MKMapView*)地图视图注释:(id)注释
{
MKAnnotationView*returnedAnnotationView=nil;
if([annotation isKindOfClass:[MAKRSampleAnnotation class]])
{
returnedAnnotationView=[MakrSampleAnnotationCreateViewAnnotationFormapView:self.mapView注释:注释];
//提供注释视图的图像
returnedAnnotationView.image=[UIImage ImageName:@“map\u pointer\u yellow.png”];
//尝试在4s中使用此功能,在iPhone 5及更高版本中使用
UIButton*rightButton=[UIButton Button类型:UIButtonTypedTailButton];
[右按钮添加目标:无操作:无控制事件:UIControlEventTouchUpInside];
((MKPinAnnotationView*)返回的AnnotationView.rightCalloutAccessoryView=rightButton;
returnedAnnotationView;
}
returnedAnnotationView;
}
我花了很多时间来解决这个问题,但没有运气把它弄出来


谢谢。

天哪!一个视图在单击时中断。拆下并固定。