title: Retrieving values from json using objective-c
body: <p>I am currently trying to work with json and objective-c however having a bit of difficulty. The following is the json that is being returned </p>
  
  <pre><code>{
      sethostname =     (
      {
          msgs = "Updating Apache configuration\nUpdating cPanel license...Done. Update succeeded.\nBuilding global cache for cpanel...Done";
          status = 1;
          statusmsg = "Hostname Changed to: a.host.name.com";
          warns =             (
          );
      });
  }
  </code></pre>
  
  <p>I am able to check that the response is coming back and the key is sethostname however no matter what I try I cannot get for example the value of status or statusmsg. Can anyone point me in the right location. The following is basic code I am using to check that sethostname is returned.</p>
  
  <pre><code>NSError *myError = nil;
  NSDictionary *res = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&amp;myError];
  NSLog([res description]);
  NSArray *arr;
  arr = [res allKeys];
  if ([arr containsObject:@"sethostname"])
  {
      NSLog(@"worked");
  }
  </code></pre>