title: Objective C - how to Json Parse a dictionary having many dictionaries inside it?
body: <p>Here is the main dictionary - 'query'. </p>
  
  <p><strong>I want to access 'results'</strong>- It is a NSDictionary having some key - pair values.</p>
  
  <p>But, <strong>all the elements of 'query' dictionary</strong> (i.e count, results, created, lang, diagnostics) are <strong>inside 'query' dictionary's 0th element.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/yEnw2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yEnw2.png" alt="enter image description here"></a></p>
  
  <p>This is what I have written to access 'results'.</p>
  
  <pre><code>NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"restuarant" ofType:@"json"]];
  
  //query is main NSDictionary
  self.query = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
  
  //results is an NSDictionary
  self.results = [_query valueForKey:@"results"][0];
  </code></pre>
  
  <p>But, when I debug it, everything is getting saved in 'query' variable but <strong>nothing is getting stored in 'results' variable</strong>.</p>
  
  <p>I also tried the following code, but that didn't work out as well -</p>
  
  <pre><code>self.results = [_query valueForKey:@"results"];
  </code></pre>
  
  <p>I have looked upon many other stackoverflow pages, but none of them suit my needs. Regards. </p>