title: Reading key value of NSDictionary set with NSJSONSerialization of JSON data in Objective-C
body: <p>So I make a simple GET request to our servers and the response code I have is as follows:</p>
  
  <pre><code>[[[NSURLSession sharedSession] dataTaskWithRequest:request
                                       completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)
        {
            NSString *dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            NSLog(@"dataString: %@", dataString);
  
            NSData *jsonData = [dataString dataUsingEncoding:NSUTF8StringEncoding];
            NSDictionary *jsonContent = (NSDictionary*)[NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&amp;error];
  
            NSNumber * success = (NSNumber *)[jsonContent objectForKey: @"user_records_exist"];
            if([success boolValue] == YES)
            {
                NSLog(@"true");
                NSLog(@"success: %d", [success boolValue]);
            } else {
                NSLog(@"false");
                NSLog(@"failure: %d", [success boolValue]);
            }
        }] resume];
  </code></pre>
  
  <p>And the logs I get are as follows:</p>
  
  <pre><code>dataString: "{\"user_records_exist\": true}"
  
  false
  failure: 0
  </code></pre>
  
  <p>Im not sure what im doing wrong. How can I get the value for the <code>"user_records_exist"</code> key?</p>
  
  <p>Thank you</p>