0

I have all concept of Maps how it works but I am stuck in very strange issue.

As soon as open my Map Controller my default blue is visible (MKUserLocation) but when I am loading custom pins (IVMyLocation, Annotation class), default pin disappear.

I am properly managing removing of custom pins so that default pin shouldn't disappear like

for (id<MKAnnotation> annotation in _mapView.annotations) {

    if([annotation isKindOfClass:[IVMyLocation class]])

        [_mapView removeAnnotation:annotation];
}

But still my default pin is disappearing. Its only visible first time.

NOTE: Its working fine in Xcode4 simulator its disappearing in only device

Tariq
  • 9,861
  • 12
  • 62
  • 103

2 Answers2

0

You should return nil for the MKUserLocation in mapView:viewForAnnotation:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id < MKAnnotation >)annotation

    if ([annotation isKindOfClass:[MKUserLocation class]])
        return nil;
    // etc

This allows the default blue dot to show.

nevan king
  • 112,709
  • 45
  • 203
  • 241
0

Reduce your objects count. Helped for me.

rudensm
  • 1,464
  • 1
  • 15
  • 17