DEPRECATED-mapbox-ios-sdk
DEPRECATED-mapbox-ios-sdk copied to clipboard
Recursion crash on [RMMapScrollView setContentSize]
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.

@incanus
@ravikvss Where are you doing this in your view controller? Can't make out the method in your image.
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
No, I mean, where is addMapView called from in your view controller lifecycle?
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.
What method?
-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.
@incanus bump ! Help please!
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.