improper url causes app to crash

600
3
01-15-2013 05:20 AM
HamzaHaroon
Occasional Contributor
When loading services, if the url is not case sensitive for the "MapServer" suffix, my app crashes if it tries to load the service. is there a way to try and catch failed map service load? or catch this error
0 Kudos
3 Replies
NimeshJarecha
Esri Regular Contributor
You should adopt AGSLayerDelegate protocol, set layer's delegate to the class where you adopted the protocol and then try to listen to the methods,  layerDidLoad: and layer:didFailToLoadWithError: to catch whether the layer is loaded successfully or there is any error.

Regards,
Nimesh
0 Kudos
HamzaHaroon
Occasional Contributor
i tried :

self.dynamicLayer.delegate = self; (dynamicLayer is of AGSDynamicMapServiceLayer)
and
self.tiledLayer.delegate = self; (AGSTiledMapServiceLayer)

but i get warnings saying incompatible pointer types.

i am adopting the AGSMapViewLayerDelegate, and the AGSLayerDelegate in my class header
0 Kudos
HamzaHaroon
Occasional Contributor
it seems my error happens when i try to connect to a mapserver folder that is empty. I get an NSRange exception saying index range 0 out of bounds for empty array
0 Kudos