title: Objective-c: Count a NSDictionary but got wrong result
body: <p>While implement the code below, I got <code>itemCount = 3</code>, but it should be <code>itemCount = 1</code> because I point to <code>Banner</code> > <code>Banner</code>. Did anyone know why I got this result and any fix for it?</p>
  
  <p>Thanks</p>
  
  <pre><code>NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLData:contents error:&amp;parseError];
  
  NSLog(@"xmlDictionary = %@", xmlDictionary);
  
  int itemCount = [[[xmlDictionary objectForKey:@"Banner"] objectForKey:@"Banner"] count];
  
  NSLog(@"itemCount = %d", itemCount);
  </code></pre>
  
  <p>LOG:</p>
  
  <pre><code>2012-03-02 12:54:49.728 BROADWAY[541:ef03] xmlDictionary = {
      Banner =     {
          Banner =         {
              date =             {
                  text = "\n        29/02/2012";
              };
              name =             {
                  text = "\n    \n        iPhone_Banner_HSB.jpg";
              };
              text = "\n    ";
          };
          text = "\n";
      };
  }
  2012-03-02 12:54:49.728 BROADWAY[541:ef03] itemCount = 3
  </code></pre>