NewMap with Listener Crashes on iOS

Hi guys,

Just to share some problem which I encountered. I have reported this under 27585.

What I am doing is showing a map ( newMapView() )with multiple markers ( addMarker() ) on an Apple and Android platform.

The setup is using a storyboard, and when the user touches the marker, the listener is called and the user is brought to a new scene ( storyboard.gotoScene() ). On my app, it crashes on iOS (simulator & device) but works on Android (device).

I further tested out the sample code, ‘MapView’ & ‘Storyboard’, and it does not crash as there is only 1 marker, but will crash with multiple markers (don’t know what is the actual number of markers ).

Work around :

Add a timer delay (timer.performWithDelay) before calling gotoScene.

Hope this helps someone.

I’ve had issues in the past (not using storyboard) where going from one screen to another via the onRowTouch() event causes problems.

If you have a touch handler installed on screen1, and in the handler itself you release / remove the screen, the SDK touch handler code could have trouble completing the event handler (because the UI object it is processing, and the entire screen it was traversing, have both been released mid-call)…

Another way to put it is that the object that triggered the touch event is removed before the event even completes (and the display list too). Depending on how the input event handlers were coded - you can imagine how this could be problematic.

So that’s why the delay fixes it entirely… The event handler for screen 1 gets to entirely complete before the triggering object (and it’s entire screen) is removed.

Thanks for the info. I also notice that if event-handler is too near removing screen, unexpected crashes will occur. A short delay always fixes all these minor issues.

After further testing, I notice it could be the behaviour on iOS, where when touching the marker will ‘pop-out’ the marker-contents again, even though it is already being shown (title, subtitle). I am guessing that the delay that i put is actually giving time for the ‘pop-out’ to finish its effect/appearence, before the listener is called. (this listener changes the scene using gotoScene) 

I’ve had issues in the past (not using storyboard) where going from one screen to another via the onRowTouch() event causes problems.

If you have a touch handler installed on screen1, and in the handler itself you release / remove the screen, the SDK touch handler code could have trouble completing the event handler (because the UI object it is processing, and the entire screen it was traversing, have both been released mid-call)…

Another way to put it is that the object that triggered the touch event is removed before the event even completes (and the display list too). Depending on how the input event handlers were coded - you can imagine how this could be problematic.

So that’s why the delay fixes it entirely… The event handler for screen 1 gets to entirely complete before the triggering object (and it’s entire screen) is removed.

Thanks for the info. I also notice that if event-handler is too near removing screen, unexpected crashes will occur. A short delay always fixes all these minor issues.

After further testing, I notice it could be the behaviour on iOS, where when touching the marker will ‘pop-out’ the marker-contents again, even though it is already being shown (title, subtitle). I am guessing that the delay that i put is actually giving time for the ‘pop-out’ to finish its effect/appearence, before the listener is called. (this listener changes the scene using gotoScene)