title: Count numberOfRowsInSection according section
body: <p>I am creating an Ipad application which will act as wine list.</p>
  
  <p>My wine list is organized in section, every section possesses a different number of row.</p>
  
  <p>My problem is that I do not manage to count the number of row according the sections.</p>
  
  <p>I parse this Json File: </p>
  
  <pre><code>   {"posts":[{"appellation":"Bordeaux Sup\u00e9rieur","nom":"Chateau David Beaulieu","annee":"2008","prix":"25"},{"appellation":"Blaye","nom":"Chateau L'Embrun","annee":"2006","prix":"35"},{"appellation":"Moulis","nom":"Ch\u00e2teau Poujeaux","annee":"1990","prix":"75"},{"appellation":"Moulis","nom":"Ch\u00e2teau Chasse-Spleen","annee":"1990","prix":"80"}]}
  </code></pre>
  
  <p>Normally I should have 2 rows for the section "Moulis" and one row for the others.
  I tried several solutions among which:</p>
  
  <pre><code>    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  
  NSString *appellation=[[self.rows objectAtIndex:section] objectForKey:@"appellation"];
  NSLog(@"appellation: %@",appellation);
  
  NSArray *cpt=[dict objectForKey:appellation];
  NSLog(@"cpt: %@",cpt);
  
  
  return [cpt count];
  }
  </code></pre>
  
  <p>it returns</p>
  
  <pre><code>2011-05-03 13:49:12.947 cha[9913:207] appellation: Moulis
  2011-05-03 13:49:12.947 cha[9913:207] cpt: (null)
  2011-05-03 13:49:12.948 cha[9913:207] appellation: Bordeaux Supérieur
  2011-05-03 13:49:12.949 cha[9913:207] cpt: (null)
  2011-05-03 13:49:12.951 cha[9913:207] appellation: Blaye
  2011-05-03 13:49:12.952 cha[9913:207] cpt: (null)
  </code></pre>
  
  <p>It returns the good sections but not the good lines.</p>
  
  <p>NSLog(@"dict %@", dict) return</p>
  
  <pre><code>2011-05-06 10:13:56.835 chan[2751:207] dict {
      posts =     (
                  {
              annee = 2008;
              appellation = "Bordeaux Sup\U00e9rieur";
              nom = "Chateau David Beaulieu";
              prix = 25;
          },
                  {
              annee = 2006;
              appellation = Blaye;
              nom = "Chateau L'Embrun";
              prix = 35;
          },
                  {
              annee = 1990;
              appellation = Moulis;
              nom = "Chateau Poujeaux";
              prix = 75;
          },
                  {
              annee = 1990;
              appellation = Moulis;
              nom = "Chateau Chasse Spleen";
              prix = 80;
  
      );
  
  }
  </code></pre>
  
  <p>This code works perfectly, but now I would like to alphabetize my wine list. My dictionnary is good create in order alphabetical. I saw in the documentation which allKeys sort the result at random, so I use:</p>
  
  <pre><code>[[[appDelegate.mutableDic allKeys]sortedArrayUsingSelector:@selector(compare:)] objectAtIndex:section];
  </code></pre>
  
  <p>in viewForHeaderInSection, and</p>
  
  <pre><code>NSDictionary *ligneVin;
  ligneVin=[[[appDelegate.mutableDic allValues ] objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
  </code></pre>
  
  <p>in cellForRowAtIndexPath, but wines do not correspond any more with sections.</p>
  
  <p>Any kind of help is very much appreciated.</p>
  
  <p>Thanks ;)</p>