title: JSON Object to NSArray
body: <p>I have to following JSON response from a server: </p>
  
  <pre><code>   {
    "theSet": [
  
    ],
    "Identifikation": 1,
    "Name": "Casper",
    "Adress": "Lovis 23",
    "Location": "At home",
    "Information": "The first, the second and the third",
    "Thumbnail": "none",
   }
  </code></pre>
  
  <p>I am retrieving the data like so: </p>
  
  <pre><code>- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
  
      NSLog(@"connectionDidFinishLoading");
  
      NSLog(@"Succeeded! Received %d bytes of data",[data length]);
  
      NSError *myError = nil;
  
       NSDictionary *res = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&amp;myError];
  
        news = [NSArray arrayWithObjects:[res allKeys], [res allValues], nil];
  
        NSLog(@"%@", news);
  
      //[mainTableView reloadData];
  }
  </code></pre>
  
  <p>Then I want to insert all the JSON data into an array, so I can display the data in my tableview. </p>
  
  <p>My tableview code: </p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MainCell"];
  
      if(cell == nil){
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MainCell"];
      }
  
      cell.textLabel.text = [[news objectAtIndex:indexPath.row] objectForKey:@"Name"];
      cell.detailTextLabel.text = [[news objectAtIndex:indexPath.row] objectForKey:@"Adress"];
  
      return cell;
  }
  </code></pre>
  
  <p>But my app crashes with the error: </p>
  
  <pre><code>-[__NSArrayI objectForKey:]: unrecognized selector sent to instance. 
  </code></pre>
  
  <p>How can I insert the JSON object into an NSArray, so I can display it in my tableview? </p>