title: Get values out of data from NSJSONSerialization
body: <p>I have some JSON data which is pulled from a URL. The code I have written works fine to download the JSON and parse it, but I cannot seem to access it how I need too, especially where the data is contained as a sub-element of another one.</p>
  
  <p>Here is the JSON format:</p>
  
  <pre><code>{
      address = "&lt;null&gt;";
      city = "&lt;null&gt;";
      country = UK;
      "country_code" = GB;
      daylight = 1;
      for = daily;
      items =     (
                  {
              asr = "5:22 pm";
              "date_for" = "2013-7-1";
              dhuhr = "1:01 pm";
              fajr = "2:15 am";
              isha = "11:47 pm";
              maghrib = "9:24 pm";
              shurooq = "4:39 am";
          }
      );
      latitude = "50.9994081";
      link = "http://muslimsalat.com/UK";
      longitude = "0.5039011";
      "map_image" = "http://maps.google.com/maps/api/staticmap?center=50.9994081,0.5039011&amp;sensor=false&amp;zoom=13&amp;size=300x300";
      "postal_code" = "&lt;null&gt;";
      "prayer_method_name" = "Muslim World League";
      "qibla_direction" = "119.26";
      query = "51.000000,0.500000";
      state = "&lt;null&gt;";
      timezone = 0;
      title = UK;
      "today_weather" =     {
          pressure = 1020;
          temperature = 14;
      };
  }
  </code></pre>
  
  <p>(These are Islamic prayer times.)</p>
  
  <p>My Objective-C so far is this:</p>
  
  <pre><code>-(CLLocationCoordinate2D) getLocation{
      CLLocationManager *locationManager = [[[CLLocationManager alloc] init] autorelease];
      locationManager.delegate = self;
      locationManager.desiredAccuracy = kCLLocationAccuracyBest;
      locationManager.distanceFilter = kCLDistanceFilterNone;
      [locationManager startUpdatingLocation];
      CLLocation *location = [locationManager location];
      CLLocationCoordinate2D coordinate = [location coordinate];
  
      return coordinate;
  }
  
  //class to convert JSON to NSData
  - (IBAction)getDataFromJson:(id)sender {
      //get the coords:
      CLLocationCoordinate2D coordinate = [self getLocation];
      NSString *latitude = [NSString stringWithFormat:@"%f", coordinate.latitude];
      NSString *longitude = [NSString stringWithFormat:@"%f", coordinate.longitude];
  
      NSLog(@"*dLatitude : %@", latitude);
      NSLog(@"*dLongitude : %@",longitude);
  
      //load in the times from the json
      NSString *myURLString = [NSString stringWithFormat:@"http://muslimsalat.com/%@,%@/daily/5.json", latitude, longitude];
      NSURL *url = [NSURL URLWithString:myURLString];
      NSData *jsonData = [NSData dataWithContentsOfURL:url];
  
      if(jsonData != nil)
      {
          NSError *error = nil;
          id result = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&amp;error];
          NSArray *jsonArray = (NSArray *)result; //convert to an array
          if (error == nil)
              NSLog(@"%@", result);
              NSLog(@"%@", jsonArray);
              for (id element in jsonArray) {
                  NSLog(@"Element: %@", [element description]);
  
              }
      }
  }
  </code></pre>
  
  <p>When running this code, the only output I get is a list of element names (<code>address, city, country</code>, so on). <code>items</code> is given, but not its child elements. I understand that this is what I am asking the code for with:</p>
  
  <pre><code>for (id element in jsonArray) {
      NSLog(@"Element: %@", [element description]);
  }
  </code></pre>
  
  <p>but I do not know how to move onto the next step.</p>
  
  <p>The only data values which I require are in fact the times themselves (so, <code>items&gt;asr</code>, <code>items&gt;dhuhr</code>, etc).</p>
  
  <p>How can I get these values themselves and then save them as values I can work with?</p>
  
  <p>Thank you!</p>