title: How should I read the data from a json string? iphone
body: <p>I have in a <code>NSString "[{"van" : 1,312, "vuan":12,123}]</code> and in order to get this values for every key, I am doing this:</p>
  
  <pre><code>    NSData *data1 = [jsonResponse1 dataUsingEncoding:NSUTF8StringEncoding];
      jsonArray = [NSJSONSerialization JSONObjectWithData:data1 options:kNilOptions error:&amp;err];
  
      self.van = [NSMutableArray arrayWithCapacity:1];
      self.vuan = [NSMutableArray arrayWithCapacity:1];
  
      for (NSDictionary *json in jsonArray) {
          NSString * value = [json objectForKey:@"van"];
          [self.van addObject:value];
          lbl1.text = value;
  
          NSString * value1 = [json objectForKey:@"vuan"];
          [self.vuan addObject:value1];
          lbl4.text = value1;
      }
  </code></pre>
  
  <p>May be I don't have to use an array and instead to convert the <code>NSData</code> directly in a <code>NSDictionary</code>. </p>
  
  <p>Anyway, I don't understand why <code>jsonArray</code> is <code>nil</code>, although <code>jsonResponse1</code> contains the values I have written above.</p>
  
  <p>EDIT: My boss have written the json string wrong. Thank you all for your suggestions!:)</p>