Using the routeTask by giving 2 addresses.

Discussion created by miribsystematics-co-il-esridist Employee on May 4, 2011
Latest reply on May 6, 2011 by njarecha-esristaff

I'm trying to find a route, using the new AGSRouteTask in ver 1.8 by giving two addresses (or current location and destination address. I found the candidates and then try to execute the routeTask.
The problem is that I get EXC_BAD_ACCESS in different places (depends if I run step by step or I run it using breakpoints). I get it in different places. I tried to put @try@catch couple but it doesn't trap this kind of exception.
I'm still fairly new in this business (although I ask a lot of questions) so maybe someone can look at the code and see what can be possible wrong.

Two notes:
1. I call [self solveRouteFromLocation:fromLocationX and:fromLocationY to:toLocationX and:toLocationY]; from both locatorF and locatorT since it runs asynchronously and I'm not sure where it will enter first.
2. Even if I go step by step and comment the line : [self.routeTaskParams setStopsWithFeatures:stops]; it does not get an exception but it does not get into didFailSolveWithError either. If I run it by using breakpoints, it crashes before that.

3. Maybe there is a better way to do it.

Enclosed with the code of the three main functions I use.

Thanks a lot. I admire the brave person who will be able to dive to somebody's else mind.

Thanks again,