NSArray

316
1
08-05-2012 05:17 PM
Si_HaoGoh
New Contributor
Is the a way to use arcgis to draw out the route using NSArray? any advice? I can't seem to find a way.
I am following the online sample routing sample.
0 Kudos
1 Reply
Si_HaoGoh
New Contributor
This is wat i tried and it got an error Property 'jsonData' not found on object of type 'MapViewController *'.

NSError *writeError = nil;
        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:path options:NSJSONWritingPrettyPrinted error:&writeError];
        NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
        NSLog(@"JSON Output: %@", jsonString);
if (self.jsonData) {
            // symbolize the returned route graphic
            self.jsonData.routeGraphic.symbol = [self routeSymbol]; //2
           
            // add the route graphic to the graphic's layer
            [self._graphicsLayer addGraphic:self.jsonData.routeGraphic];//3
           
            // tell the graphics layer to redraw
            [self._graphicsLayer dataChanged];
        }
0 Kudos