Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 正在调用DidSelect注释_Ios_Objective C_Mkmapview_Uitapgesturerecognizer - Fatal编程技术网

Ios 正在调用DidSelect注释

Ios 正在调用DidSelect注释,ios,objective-c,mkmapview,uitapgesturerecognizer,Ios,Objective C,Mkmapview,Uitapgesturerecognizer,我在地图视图中添加了一个点击手势识别器。我的地图视图有注释,当我点击注释时,只调用dismisscolectionview。未调用DidSelectAnnotation方法。当我点击一个注释时,如何停止tap手势方法(dismisscollection)调用?任何帮助都将不胜感激 self.m_mapView = [[MKMapView alloc] init]; self.m_mapView.frame = CGRectMake(0, 0, 320, 568); self.m_

我在地图视图中添加了一个点击手势识别器。我的地图视图有注释,当我点击注释时,只调用
dismisscolectionview
。未调用DidSelectAnnotation方法。当我点击一个注释时,如何停止tap手势方法(dismisscollection)调用?任何帮助都将不胜感激

self.m_mapView = [[MKMapView alloc] init];
    self.m_mapView.frame = CGRectMake(0, 0, 320, 568);
    self.m_mapView.delegate = self;

   // MapHeight = self.m_mapView.frameHeight;

    m_locationManager = [[CLLocationManager alloc] init];

    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
        [m_locationManager requestWhenInUseAuthorization];
        [m_locationManager requestAlwaysAuthorization];
    }
    self.m_mapView.mapType = MKMapTypeStandard;
    [self.m_mapView setUserTrackingMode:MKUserTrackingModeFollow];
    [self.m_bgImageView addSubview:self.m_mapView];

    m_locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    m_locationManager.delegate = self;


    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissCollectionView)];
    tapGesture.numberOfTouchesRequired = 1;
    tapGesture.cancelsTouchesInView = NO;
    [self.m_mapView addGestureRecognizer:tapGesture];

如果您希望两个动作都发生:设置手势识别器的委托并实现,以返回识别器和地图视图内部使用的任何动作的
YES

如果希望
dismissCollectionView
mapView:didSelectAnnotationView:
相互排斥
:实现并检查触摸位置是否位于
MKAnnotationView
或其子视图中。仅当位置位于所有注释视图之外时才返回
YES