title: Parse nested JSON Object in Objective-C
body: <p>Perhaps I am over-thinking or confusing myself, but my head is stuck in a loop over this and I cannot break out.</p>
  
  <p>I have a a JSON of the format: (Validated at <a href="http://jsonformatter.curiousconcept.com/" rel="nofollow">http://jsonformatter.curiousconcept.com/</a>)</p>
  
  <pre><code>{
    id: 1,
    sections: "5",
    total: "10",
    result: {
      3: 00PM: [
        {
          name: "Anurag",
          status: "Web"
        },
        {
          name: "Anurag2",
          status: "Web2"
        }
      ],
      5: 00PM: [
        {
          name: "Anurag",
          status: "Seated"
        }
      ],
      6: 00PM: [
        {
          name: "Anurag4",
          status: "Web4"
        },
        {
          name: "Anurag5",
          status: "Web5"
        },
        {
          name: "Anurag6",
          status: "Web6"
        },
        {
          name: "Anurag7",
          status: "Web7"
        }
      ]
    }
  }
  </code></pre>
  
  <p>I have this so far:</p>
  
  <pre><code>        NSDictionary *dict = [response JSONValue];
          NSDictionary *results = [dict objectForKey:@"result"];
  
          NSInteger num_results = [[dict valueForKey:@"total"] intValue];
          NSInteger num_sections = [[dict valueForKey:@"sections"] intValue];
  
          NSMutableArray *sections = [[NSMutableArray alloc] initWithCapacity:num_sections];
          NSMutableArray *objarr = [[NSMutableArray alloc] initWithCapacity:num_results];
          NSMutableArray *obj= [[NSMutableArray alloc] initWithCapacity:num_sections];
          NSMutableArray *temp = [[NSMutableArray alloc] initWithCapacity:num_results];
  
          for (NSString* key in results) {
              NSLog(@"Key: %@", key); // prints out 3:00 PM...5:00 PM etc...
              [obj addObject:[results objectForKey:key]]; // nested objects within each key are saved in the array
              NSLog(@"Object 1: %@", obj);
          }
  
          for (int i = 0; i &lt; [obj count]; i++) {
              //NSLog(@"Object 2: %@", [obj objectAtIndex:i]);
              [temp addObject:[obj objectAtIndex:i]]; // I take each object from previous array and save it in a temp array
              for (int i = 0; i &lt; num_results; i++) {
                  NSLog(@"Object 3: %@", [temp objectAtIndex:i]);
                  **[objarr addObject:[temp objectAtIndex:i]]; // I want to extract the object within the object but cannot get it to work**
              }   
          }
  </code></pre>
  
  <p>I am able to make an array of objects within each of the 3 keys inside results. But I am not able to get each of the objects inside them as a separate object and save them in an array.</p>
  
  <p>For example, in an NSArray I have:</p>
  
  <pre><code>Object 3: (
          {
          name = "Anurag ";
          status = Web;
      },
          {
          name = "Anurag ";
          status = Web;
      }
  )
  </code></pre>
  
  <p>How can I get the two objects inside this object and save them both in an array? 
  I guess the main issue is I cannot refer to a key name to get the individual object. </p>