Question: 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 

```
{
    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 =             (
        );
    });
}

```

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.

```
NSError *myError = nil;
NSDictionary *res = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&myError];
NSLog([res description]);
NSArray *arr;
arr = [res allKeys];
if ([arr containsObject:@"sethostname"])
{
    NSLog(@"worked");
}

```

Answer: 
Why not use the simplest JSON method - `[myString jsonValue];`

It's part of this [JSON framework](https://github.com/stig/json-framework) for objective-c
I don't think `if ([arr containsObject:@"sethostname"])` is going to work, because the results array is not going to contain that exact object. It might contain an object with the same content, but it won't be the SAME object.

As jtbandes wrote, you need to log the actually output. NSLog both res and arr and see what you have.