Inserting map layer crash.

522
1
07-25-2013 09:33 PM
brettlamy
New Contributor
Hi, I am using the latest ios SDK release and whenever I switch layers the application crashes with the following error.




If I try to add any layer at all without a name it crashes with this error.


If I give it a name the tpks will work when I first load the map but if I try to change the TPK later on it will crash with the same error. From what i'm guessing is it thinks the name is null however, If you look at the log statement right above the line it crashed on you can clearly see the layer name is not null.
0 Kudos
1 Reply
ChristopherBarger
New Contributor
Hello,

So long as the tpk resource is in your project, maybe you could try to display the resource this way? I was having similar problems and this solved the issue for me. Also make sure that your tpk file is included in your copy bundle resources.


NSString *mobilePath = [[NSBundle mainBundle] pathForResource:@"YourTPKName" ofType:@"tpk"];
AGSLocalTiledLayer *tiledLayer = [AGSLocalTiledLayer localTiledLayerWithPath:mobilePath];
[mapView insertMapLayer:tiledLayer withName:@"Choose a name here for access later" atIndex:0];
0 Kudos