title: JSON object returning empty string for key that has a value
body: <p>I have never done any kind of web programming but I need to request a JSON object and save the data in objective-c form. I am using the documentation at <code>http://eandata.com/blog/e53/data-feed-v3---access-and-data-layout/</code> but I am unable to retrieve any of the strings associated with a matching key. An example JSON object I am trying to parse is <code>http://eandata.com/feed/?v=3&amp;keycode=027F74ED52886617&amp;mode=json&amp;find=883929215010&amp;get=all</code> The top level JSON object returns three keys; status, product, and company. So I access the product key and assign it to  an NSDictionary. In that dictionary is another NSDictionary with the key attributes, so I pull out that dictionary and assign it. Inside the attributes dictionary is a key product with the value of a string. This is the string I need to get, but for some reason it is printing as the empty string. Here is the relevant code. </p>
  
  <p>Scanning the barcode and initiation of GET request</p>
  
  <pre><code>#pragma  ZBarDelegate
  - (void) imagePickerController: (UIImagePickerController*) reader
   didFinishPickingMediaWithInfo: (NSDictionary*) info
  {
      // ADD: get the decode results
      id&lt;NSFastEnumeration&gt; results =
      [info objectForKey: ZBarReaderControllerResults];
      ZBarSymbol *symbol = nil;
      for(symbol in results)
          break;
  
      NSString *scannedNumber = symbol.data;//@"0049000006582";
      NSString *name = symbol.typeName;
      NSLog(@"The type name is %@", name);
  
      NSString *eanDataExample =
      @"http://eandata.com/feed/?v=3&amp;keycode=027F74ED52886617&amp;mode=json&amp;find=";
      [ eanDataExample stringByAppendingString:scannedNumber ];
      eanDataExample =
      [ eanDataExample stringByAppendingString:@"&amp;get=all" ];
  
      NSURL *url = [ NSURL URLWithString:eanDataExample ];
      NSURLRequest *request =
      [ NSURLRequest requestWithURL:url ];
      connection = [ NSURLConnection connectionWithRequest:request delegate:self ];
      if ( connection ) {
          webData = [ [ NSMutableData alloc ] init];
      }
      /*resultImage.image =
      [info objectForKey: UIImagePickerControllerOriginalImage];*/
  
      // ADD: dismiss the controller (NB dismiss from the *reader*!)
      [reader dismissModalViewControllerAnimated: YES];
  }
  </code></pre>
  
  <p>Here are the URLConnection delegate methods</p>
  
  <pre><code>#pragma NSURLConnectionDataDelegate Methods
  - (void)connection:(NSURLConnection *)connection
  didReceiveResponse:(NSURLResponse *)response {
      [webData setLength:0 ];
  
  }
  - (void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
      [ webData appendData:data ];
  }
  
  -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
  }
  
  -(void) connectionDidFinishLoading:(NSURLConnection *)connection {
      NSDictionary *allDataDictionary =
      [ NSJSONSerialization JSONObjectWithData:webData options:0 error:nil ];
      NSArray *keys = [ allDataDictionary allKeys ];
      NSLog(@"The count of all keys is %d", keys.count);
      NSDictionary *product = [ allDataDictionary objectForKey:@"product"];
      NSDictionary *attributes = [ product objectForKey:@"attributes"];
      NSLog(@"The number of attributes are %d", attributes.count);
      NSArray *attKeys = [ attributes allKeys ];
      NSString *desc;
      for (NSString *s in attKeys) {
          if ( [ [ attributes objectForKey:s ] isKindOfClass:[NSString class ] ] ) {
              NSLog(@"The %@ object is a NSSTring", s);
          }
          NSLog(@"The att key is %@", s );
          if ( [ s isEqualToString:@"product"] ) {
              desc =
              [ attributes objectForKey:@"product" ];
              NSLog(@"The description is %@", desc);
          }
      }
  
  }
  </code></pre>
  
  <p>Relevant log statements. I have only included those related to the field I am trying to access.</p>
  
  <pre><code>2013-11-17 11:25:21.254 Collections[860:60b] The product object is a NSSTring
  2013-11-17 11:25:21.255 Collections[860:60b] The att key is product
  2013-11-17 11:25:21.256 Collections[860:60b] The description is 
  </code></pre>