title: Loop through NSDictionary to create separate NSArrays
body: <p>I have a large <code>NSDictionary</code> that I need to loop through and create separate <code>NSArray</code>s.  Here are the contents:</p>
  
  <pre><code>(
          {
          id =         {
              text = "";
          };
          sub =         {
              text = " , ";
          };
          text = "";
          "thumb_url" =         {
              text = "";
          };
          title =         {
              text = "2010-2011";
          };
          type =         {
              text = "title";
          };
      },
          {
          id =         {
              text = "76773";
          };
          sub =         {
              text = "December 13, 2010";
          };
          text = "";
          "thumb_url" =         {
              text = "http://www.puc.edu/__data/assets/image/0004/76774/varieties/thumb.jpg";
          };
          title =         {
              text = "College Days - Fall 2010";
          };
          type =         {
              text = "gallery";
          };
      },
          {
          id =         {
              text = "";
          };
          sub =         {
              text = "";
          };
          text = "";
          "thumb_url" =         {
              text = "";
          };
          title =         {
              text = "2009-2010";
          };
          type =         {
              text = "title";
          };
      },
          {
          id =         {
              text = "76302";
          };
          sub =         {
              text = "December 3, 2010";
          };
          text = "";
          "thumb_url" =         {
              text = "http://www.puc.edu/__data/assets/image/0019/76303/varieties/thumb.jpg";
          };
          title =         {
              text = "Christmas Colloquy";
          };
          type =         {
              text = "gallery";
          };
      }
  )
  </code></pre>
  
  <p>Each section has a type key, which I need to check.  When it finds the <code>title</code> key, I need to add those to an array.  Then the next sections that would use the <code>gallery</code> key needs to be in its own array until it finds another <code>title</code> key.  Then the <code>gallery</code> keys after that into their own array.</p>
  
  <p>I am using a <code>UITableView</code> section titles and content.  So, the <code>NSDictionary</code> above should have one <code>NSArray *titles;</code> array, and two other arrays each containing the galleries that came after the title.</p>
  
  <p>I have tried using a <code>for</code> loop but I just can't seem to get it right.  Any ideas would be appreciated.</p>