Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

annotation reload crash #7170

Closed
Closed

Description

@halset

Platform: iOS
Mapbox SDK version: master as of edb487b

Steps to trigger behavior

  1. Change some property of an annotation that makes it switch between annotation image and view. Typically to make one feature moveable and the rest not.
  2. removeAnnotation + addAnnotation to tell MGLMapView to reload the annotation. Is there an other way to tell the MGLMapView to re-ask its delegate wether the annotations should be drawn as a image or with a view?

Expected behavior

The annotation should switch between image and view without problem.

Actual behavior

It sometimes work and sometimes crash with the following stack trace.

2016-11-23 14:12:49.756 MyApp[7830:52298849] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001136e934b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x000000011309f21e objc_exception_throw + 48
	2   CoreFoundation                      0x000000011361a38f -[__NSArrayM insertObject:atIndex:] + 1375
	3   Mapbox                              0x000000010de1b58e -[MGLMapView visibleAnnotationsInRect:] + 846
	4   Mapbox                              0x000000010de3356d -[MGLMapView updateAnnotationViews] + 989
	5   Mapbox                              0x000000010de32e20 -[MGLMapView notifyMapChange:] + 3488
	6   Mapbox                              0x000000010de3b9cd _ZN8MBGLView15notifyMapChangeEN4mbgl9MapChangeE + 61
	7   Mapbox                              0x000000010de3bc43 _ZThn8_N8MBGLView15notifyMapChangeEN4mbgl9MapChangeE + 35
	8   Mapbox                              0x000000010e0e7040 _ZN4mbgl3Map6renderERNS_4ViewE + 592
	9   Mapbox                              0x000000010de00078 -[MGLMapView glkView:drawInRect:] + 136
	10  GLKit                               0x0000000114967148 -[GLKView _display:] + 304
	11  Mapbox                              0x000000010de01670 -[MGLMapView updateFromDisplayLink] + 736

Activity

  1. friedbunny commented on Nov 23, 2016

    @friedbunny
    Contributor

    Please include the specific commit hash when reporting issues with master. Thanks!

  2. halset commented on Nov 23, 2016

    @halset
    ContributorAuthor

    @friedbunny Thank you for the reminder. I have added it to the description.

  3. halset commented on Nov 23, 2016

    @halset
    ContributorAuthor

    Sorry, but it looks like the problem only happen when I reload an annotation belonging to a MGLMapView that are dismissed at (almost) the same time.. That might be too much stress going on at the same time.

  4. halset commented on Nov 23, 2016

    @halset
    ContributorAuthor

    Well, not only when the MGLMapView is dismissed.

  5. added
    iOS
    on Nov 23, 2016
  6. boundsj commented on Nov 23, 2016

    @boundsj
    Contributor

    @halset we've made several improvements the way view annotations are handled that are currently only in the Mapbox iOS SDK 3.4.0 release branch. Can you test using the release branch (https://github.com/mapbox/mapbox-gl-native/tree/release-ios-v3.4.0) or the latest published beta (currently https://github.com/mapbox/mapbox-gl-native/tree/release-ios-v3.4.0)? Thanks.

  7. halset commented on Nov 23, 2016

    @halset
    ContributorAuthor

    @boundsj tried with latest of the release-ios-v3.4.0 branch as of 67e079f now and it works perfect! :) Will that one go to master when 3.4.0 are released?

  8. friedbunny commented on Nov 23, 2016

    @friedbunny
    Contributor

    @halset Yup, we will merge the release branch back into master once the release is finalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions