<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AGSRouteTaskDelegate never entering delegate methods on solve in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsroutetaskdelegate-never-entering-delegate/m-p/639359#M5681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the self.task property using a strong reference?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If not, the task might be getting dealloc'd before the delegate can be invoked.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Feb 2014 04:43:46 GMT</pubDate>
    <dc:creator>DiveshGoyal</dc:creator>
    <dc:date>2014-02-04T04:43:46Z</dc:date>
    <item>
      <title>AGSRouteTaskDelegate never entering delegate methods on solve</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsroutetaskdelegate-never-entering-delegate/m-p/639358#M5680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm getting a routing service up and running. But after setting up my AGSRouteTask and AGSRouteTaskParams with some stops, my app never enters either the success or failure method of the AGSRouteTaskDelegate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have my mapview, agsroutetask, and routetaskparameters as properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my viewDidLoad, I load in the basemap, which displays as it should.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then in mapViewDidLoad, I set the routetask and routetask params, input some test values for stops, and solve, as shown:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

- (void)mapViewDidLoad:(AGSMapView *)mapView {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //set up the routeTask
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSError *error = nil;
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.task = [AGSRouteTask routeTaskWithDatabaseName:@"new_file_geodatabase" network:@"sidewalks_ND" error:&amp;amp;error];
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.task.delegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; //set up the routetaskparameters
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params = [AGSRouteTaskParameters routeTaskParameters];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.task retrieveDefaultRouteTaskParameters];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSMutableArray *stopsMutArr = [[NSMutableArray alloc] init];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *ptOne = [AGSPoint pointWithX:-111.55 y:40.23 spatialReference:self.mapView.spatialReference];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSSymbol *symbOne;
&amp;nbsp;&amp;nbsp;&amp;nbsp; symbOne.color = [UIColor greenColor];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSStopGraphic *startPt = [AGSStopGraphic graphicWithGeometry:ptOne symbol:symbOne attributes:nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [stopsMutArr addObject:startPt];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *ptTwo = [AGSPoint pointWithX:-111.6 y:40.25 spatialReference:self.mapView.spatialReference];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSSymbol *symbTwo;
&amp;nbsp;&amp;nbsp;&amp;nbsp; symbTwo.color = [UIColor greenColor];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSStopGraphic *endPt = [AGSStopGraphic graphicWithGeometry:ptTwo symbol:symbTwo attributes:nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [stopsMutArr addObject:endPt];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSArray *stopsArr = [stopsMutArr copy];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSGraphicsLayer *graphicsLayer = [AGSGraphicsLayer graphicsLayer];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [graphicsLayer addGraphics:stopsArr];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.mapView addMapLayer:graphicsLayer];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.params setStopsWithFeatures:stopsArr];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params.returnStopGraphics = YES;
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params.returnRouteGraphics = YES;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.task solveWithParameters:self.params];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

}

- (void)routeTask:(AGSRouteTask *)routeTask operation:(NSOperation *)op didSolveWithResult:(AGSRouteTaskResult *)routeTaskResult {
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Navigation worked!");
}

- (void)routeTask:(AGSRouteTask *)routeTask operation:(NSOperation *)op didFailSolveWithError:(NSError *)error {
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Error: %@", error);
}


- (void)routeTask:(AGSRouteTask *)routeTask operation:(NSOperation *)op didRetrieveDefaultRouteTaskParameters:(AGSRouteTaskParameters *)routeParams {
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params = routeParams;
}

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is, my application never gets into either my didSolveWithResult or didFailSolveWithError methods. My app keeps running as it did before, as if nothing happened. I've set myself as the routetaskdelegate and am implementing the required method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Feb 2014 00:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsroutetaskdelegate-never-entering-delegate/m-p/639358#M5680</guid>
      <dc:creator>StevenKitterman1</dc:creator>
      <dc:date>2014-02-01T00:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: AGSRouteTaskDelegate never entering delegate methods on solve</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsroutetaskdelegate-never-entering-delegate/m-p/639359#M5681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the self.task property using a strong reference?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If not, the task might be getting dealloc'd before the delegate can be invoked.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 04:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsroutetaskdelegate-never-entering-delegate/m-p/639359#M5681</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2014-02-04T04:43:46Z</dc:date>
    </item>
  </channel>
</rss>

