2016-01-07 37 views
1

我將我的mapView代理設置爲自我,以便我的引腳標註起作用,當我這樣做時,我的當前位置也顯示爲引腳。我該如何解決這個問題? enter image description heremapView.delegate = self與當前位置

mapView.delegate = self 


    self.locationManager.delegate = self 


    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest 


    self.locationManager.requestWhenInUseAuthorization() 


    self.locationManager.startUpdatingLocation() 


    self.mapView.showsUserLocation = true 
+0

添加一些代碼.. –

+2

什麼是您的具體問題? –

回答

2
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {  
    if annotation.isKindOfClass(MKUserLocation) { 
     return nil 
    } 
} 
1
func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView! { 

     if (annotation is MKUserLocation) { 

      return nil 
     }