title: How to group a tableview with dynamicaly sections in iOS
body: <p>I call a webservice and get a nice JSON in return. This JSON lists a couple of reports with category. </p>
  
  <p>The big question is how I can make a nice looking tableview with this, grouped by category. Im new to iOS, and I am really stucked at this point. </p>
  
  <p>I save the json in an array like this: </p>
  
  <pre><code>tableData = [NSJSONSerialization JSONObjectWithData:dataWebService options:kNilOptions error:&amp;error];
  </code></pre>
  
  <p>And then I sort the list: </p>
  
  <pre><code>NSArray *sortedArray;
  NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Category"  ascending:YES];
  sortedArray = [tableData sortedArrayUsingDescriptors:[NSArray arrayWithObject:descriptor]];
  </code></pre>
  
  <p>The json I get is this: </p>
  
  <pre><code>{
          Category = Faktura;
          about = "Fakturablankett med giro med utvalg p\U00e5 fra-til fakturanr";
          name = Faktura;
          reportendpoint = "https://unionline.unimicro.no/uni24Report/Report.aspx";
          reportid = 16;
      },
              {
          Category = Faktura;
          about = "Fakturablankett med giro med utvalg p\U00e5 fra-til fakturanr";
          name = "Faktura med sidenummer";
          reportendpoint = "https://unionline.unimicro.no/uni24Report/Report.aspx";
          reportid = 19;
      },
              {
          Category = Faktura;
          about = "Liste over fakturaer med status og mva-detaljer. Utvalg p\U00e5 fra-til fakturanr.";
          name = Fakturajournal;
          reportendpoint = "https://unionline.unimicro.no/uni24Report/Report.aspx";
          reportid = 15;
      },
              {
          Category = "Journaler og Kontoutskrifter";
          about = "";
          name = "Kontoutskrift hovedbok";
          reportendpoint = "https://unionline.unimicro.no/uni24Report/Report.aspx";
          reportid = 4;
      },
              {
          Category = "Journaler og Kontoutskrifter";
          about = "";
          name = "Kontoutskrift kunder";
          reportendpoint = "https://unionline.unimicro.no/uni24Report/Report.aspx";
          reportid = 5;
      }
  </code></pre>
  
  <p>I would like to list these "name" in a tableview, grouped by "Category". I need to sort the category an list the reports who belongs to these categories. </p>
  
  <p>There is many more categories, but I didn´t paste them all. </p>