title: How to get an integer value from NSDictionary?
body: <p>I am having this weird issue. NSDictionary is not returning the correct integer value. </p>
  
  <p>JSON response code from server.</p>
  
  <pre><code>{
  "status":"ok",
  "error_code":0,
  "data" : [],
  "msg":"everything is working!"
  }
  </code></pre>
  
  <p>The JSON is being converted to a NSDictionary.</p>
  
  <pre><code>NSError *error = nil;
  NSDictionary *jsonDict = [NSJSONSerialization
                            JSONObjectWithData:data
                            options:NSJSONReadingMutableContainers
                            error: &amp;error];
  </code></pre>
  
  <p>I access the NSDictionary value using the following code.</p>
  
  <pre><code>int error_code = (int)[jsonDict valueForKey:@"error_code"]
  NSLog(@"%i", error_code);
  The log outputs the following: 143005344
  </code></pre>
  
  <p>I've even tried objectForKey and I get the same response. </p>
  
  <p>Thanks, in advance. </p>