DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Recursion crash on [RMMapScrollView setContentSize]

Open ravikvss opened this issue 10 years ago • 8 comments
trafficstars

RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:@"company.xxxxxx"];
self.mapView.userTrackingMode = RMUserTrackingModeFollow;
self.mapView.tileSource = tileSource;

That's my code. Upon initialization and setting the tileSource, there's a recursion on setContentSize in the inner workings of MapBox and it crashes. I'm using 1.5.1 through CocoaPods.

screen shot 2015-01-30 at 5 55 27 pm

@incanus

ravikvss avatar Jan 31 '15 01:01 ravikvss

@ravikvss Where are you doing this in your view controller? Can't make out the method in your image.

incanus avatar Feb 03 '15 22:02 incanus

Here's my complete map-adding sourcecode.

- (void)addMapView
{
  RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:@"company.xxxxx"];
  self.mapView.userTrackingMode = RMUserTrackingModeFollow;
  self.mapView.tileSource = tileSource;
  self.mapView.delegate = self;
  self.mapView.showsUserLocation = YES;
  self.mapView.showLogoBug = NO;
  self.mapView.hideAttribution = YES;
  [self.mapView setZoom:DESIRED_ZOOM_LEVEL];
}

I check for the location permissions, show an alert box asking for permissions if I don't have them yet and then finally call the above method. self.mapView is an IBOutlet

ravikvss avatar Feb 03 '15 23:02 ravikvss

No, I mean, where is addMapView called from in your view controller lifecycle?

incanus avatar Feb 03 '15 23:02 incanus

After all the views are loaded. There's a button - pressing which an action method is triggered and that swaps out an existing image view and replaces it with the mapview in the same place.

ravikvss avatar Feb 04 '15 00:02 ravikvss

What method?

incanus avatar Feb 04 '15 01:02 incanus

-addMapView is called inside the action selector/method that gets invoked after the said button is pressed.

It's been a while since we made any change to this code and it worked for a while, but doesnt seem to anymore.

ravikvss avatar Feb 04 '15 07:02 ravikvss

@incanus bump ! Help please!

ravikvss avatar Feb 12 '15 02:02 ravikvss

Bump. We're running into this same issue when changing mapView.tileSource is it likely to be view lifecycle related @incanus ? We're doing this when the RMMapView is loaded, but offscreen.

drhaynes avatar Apr 29 '15 12:04 drhaynes