title: NSJSON how to parse
body: <p>I am having issues getting the json format by a specific "". I can see that it is a dictionary so am I turning the dictionary into an array wrong? I am trying to pull the records that "isReserevble=true" and then display the "begin" with just the time in the table view cells based on the user selection from a UIDatepicker.
  The json is coming through with NSlog but I am not able to figure this out. Thanks</p>
  
  <p>It looks like I hae an array of dictionaries. Would I still use the same methods?</p>
  
  <p>here is my code. </p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      dispatch_async(kBgQueue, ^{
          NSData* data = [NSData dataWithContentsOfURL: 
                          kLatestKivaLoansURL];
          [self performSelectorOnMainThread:@selector(fetchedData:) 
                                 withObject:data waitUntilDone:YES];
  
      });
  
  }
  - (void)fetchedData:(NSData *)responseData {
  //parse out the json data
  
  NSError* error;
  
  NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&amp;error];
  
  NSArray* myslots =[json objectForKey:@"slots"];
  NSLog(@"allslots: %@", myslots);
  
  
    NSMutableArray *datesArray = [[NSMutableArray alloc] init];
  for (NSDictionary *slots in json){
      NSLog(@"isReservable = %@",[myslots objectForKey:@"isReservable"]);
      if ([[myslots objectForKey:@"isReservable"]isEqualToString:@"1"]) 
      {
          NSLog(@"begin = %@",[myslots objectForKey:@"begin"]);
          [datesArray addObject:[myslots objectForKey:@"begin"]];
          NSLog(@"slots array count = %d",[datesArray count]);
      }
  
  }
  NSLog(@"This is the begin: %@", datesArray);
  
  }
  </code></pre>
  
  <p>Here is my result of NSLog all slots:</p>
  
  <pre><code>2012-08-29 11:54:26.531 GBSB[1137:15b03] allslots: {
      "2012-08-29 00:00:00 America/Los_Angeles" =     (
                  {
              begin = "2012-08-29 00:00:00 America/Los_Angeles";
              end = "2012-08-29 08:00:00 America/Los_Angeles";
              isPending = 0;
              isReservable = 0;
              isReserved = 0;
              label = "&amp;nbsp;";
              span = 1;
          },
                  {
              begin = "2012-08-29 08:00:00 America/Los_Angeles";
              end = "2012-08-29 08:15:00 America/Los_Angeles";
              isPending = 0;
              isReservable = 1;
              isReserved = 0;
              label = "&amp;nbsp;";
              span = 1;
          }
      );
  }
  </code></pre>
  
  <p>Ok: Here is now what I am getting</p>
  
  <pre><code>2012-08-30 09:28:30.812 GBSB[835:15b03] its a dictionary
  2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
  2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
  2012-08-30 09:28:30.812 GBSB[835:15b03] isReservable = (null)
  2012-08-30 09:28:30.813 GBSB[835:15b03] This is the begin: (
  )
  </code></pre>