Property 'jsonData' not found on object of type 'MapViewController *'

I am trying to draw the route on the graphic layer of my app application and i do not know is this the right approach to do it, or is there another way to do it? Where i am trying to use NSArray with ArgGIS to draw out the map am i have problem with it.

*edit I tried to change the NSArray back to a JSON string and try to draw it using ArcGIS with a JSON string

This is what i have done:

NSArray *BusRoute=[jsonResult objectForKey:@"BusRoute"];
int i;
int count = [BusRoute count];
for (i = 0; i < count; i++)
{   
    NSDictionary *dic = [BusRoute objectAtIndex: i];
    NSString *Duration = [dic valueForKey:@"Duration"];
    //---PATH---
    NSArray *PATH = [dic valueForKey:@"PATH"]; 
    NSLog(@"PATH = %@", PATH);
    self.path = PATH;
}
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.jsonString) {
        // symbolize the returned route graphic
        self.jsonString.routeGraphic.symbol = [self routeSymbol]; 

        // add the route graphic to the graphic's layer
        [self._graphicsLayer addGraphic:self.jsonString.routeGraphic];

        // tell the graphics layer to redraw
        [self._graphicsLayer dataChanged];
    }

*Output for JSON string

JSON Output: [
  [
     "38909,35576;38872,35589;38861,35593;38848,35597;38697,35650;38695,35651;38695,35651;38609,35681;38583,35689;38553,35697;38508,35700;38476...;29560,40043"
  ]
]

This is a portion of the path that i have to draw on the map:

PATH = ((  "38909,35576;38872,35589;38861,35593;38848,35597;38697,35650;38695,35651;38695,35651;38609,35681;38583,35689;38553,35697;38508,35700;38476,35696;38476,35696;....))

for this line self.jsonData.routeGraphic.symbol = [self routeSymbol]; i am getting an error Property 'Property 'jsonData' not found on object of type 'MapViewController *'

what should i do to solve? pls help


*How can i draw the line of the path using the NSArray and using ArcGIS?

Answers


routeGraphic property does not have any association with NSArray Class. NSArray is the Collection.

Your code is a little strange.

what is routeGrphic???

Are not you forgotten the like code below?

YourObject *object = [path objectAtIndex:index];
object.routeGraphic.symbol = [self routeSymbol];

Need Your Help

setting position with three.js and CSG

javascript three.js csg

when i use this as code for a cube and a sphere which cuts some part of this cube out:

How to propagate values from one row in a pandas Dataframe to all other rows

python numpy pandas vectorization

I need to set all rows in a dataframe based on the adjacent row on the side closest to some index. The context is the dataframe is full of estimates, and rows can be corrected based on a row next t...