# Tapping the current location marker on iOS preview crashes the app

**URL:** <https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706>\
**Category:** Bug Reports\
**Created:** [July 28, 2017, 12:50pm UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706 "2017-07-28T12:50:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Costin\_Bereveanu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/costin_bereveanu/32/628_2.png) [@Costin\_Bereveanu](https://forums.fusetools.com/u/Costin_Bereveanu)\
**Post date:** [July 28, 2017, 12:50pm UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/1 "2017-07-28T12:50:06Z")

</div>

Having ShowMyLocation on on iOS (preview) and tapping on the current location marker crashes the app. I think this is not new.  
On a different note, setting ShowMyLocationButton to true does nothing.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 28, 2017, 2:33pm UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/2 "2017-07-28T14:33:53Z")

</div>

Thanks for reporting! Here’s [a ticket](https://github.com/fusetools/fuselibs-public/issues/309) for it.

---

<div class="post-metadata">

**Author:** ![Thomas\_Ribreau](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/thomas_ribreau/32/697_2.png) [@Thomas\_Ribreau](https://forums.fusetools.com/u/Thomas_Ribreau)\
**Post date:** [March 19, 2018, 11:40am UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/3 "2018-03-19T11:40:33Z")

</div>

Hi  
I just want to warn that even in 1.7, ShowMyLocation on iOS (preview and release) and tapping on the current location marker crashes the app. Do you have any news on when it will be fixed?  
Thank you

---

<div class="post-metadata">

**Author:** ![Thomas\_Ribreau](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/thomas_ribreau/32/697_2.png) [@Thomas\_Ribreau](https://forums.fusetools.com/u/Thomas_Ribreau)\
**Post date:** [March 20, 2018, 10:56am UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/4 "2018-03-20T10:56:40Z")

</div>

Ok, here is the fix:  
In MapViewDelegate.m :  
Replace :

```auto
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
	{
            if(markerSelectBlock){
                FusePinAnnotation* a = [view annotation];
                markerSelectBlock(a.markerID, a.title);
            }
	}

```

By :

```auto
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
	{
        id annotation = view.annotation;
        if (![annotation isKindOfClass:[MKUserLocation class]]) {
            if(markerSelectBlock){
                FusePinAnnotation* a = [view annotation];
                markerSelectBlock(a.markerID, a.title);
            }
        }
	}

```

And in :

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

```

Add the following lines in the beginning of the method:

```auto
  if ([annotation isKindOfClass:[MKUserLocation class]])
            return nil; //return nil to use default blue dot view

```

And that’s all!

---

<div class="post-metadata">

**Author:** ![Thomas\_Ribreau](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/thomas_ribreau/32/697_2.png) [@Thomas\_Ribreau](https://forums.fusetools.com/u/Thomas_Ribreau)\
**Post date:** [March 20, 2018, 11:17am UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/5 "2018-03-20T11:17:12Z")

</div>

Here is my Pull Request:  
[https://github.com/fusetools/fuselibs-public/pull/1122](https://github.com/fusetools/fuselibs-public/pull/1122)

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [March 21, 2018, 7:41am UTC](https://forums.fusetools.com/t/tapping-the-current-location-marker-on-ios-preview-crashes-the-app/3706/6 "2018-03-21T07:41:26Z")

</div>

Wonderful job, Thomas! Thank you.
