title: create array of dictionaries from sqlite DB with FMDB
body: <p>I am new to objective-c and I am trying to create an array of dictionaries in an effort to view them in a NSTableView with three columns. the sqlite DB schema has three columns as well, "foo", "bar", and "foobar" in a table called "tbl1". i am using FMDB as a wrapper, and i can write and query successfully. </p>
  
  <p>i can create an array for the entire DB with this: </p>
  
  <pre><code>FMResultSet *rs = [db executeQuery:@"select * from tbl1"];
  </code></pre>
  
  <p>and i can create a dictionary with this:</p>
  
  <pre><code>dict = [[NSMutableDictionary alloc] init];
  [dict setObject: @"baz"        
        forKey: @"foo"];
  </code></pre>
  
  <p>reading each item in the DB works:</p>
  
  <pre><code>while ([rs next]) {
      NSLog(@"%@, %@, %@", 
            [rs stringForColumn:@"foo"],
            [rs stringForColumn:@"bar"],
            [rs stringForColumn:@"foobar"]);
      }
  </code></pre>
  
  <p>however, i cannot seem to create a single array of NSMutableDictionaries so I can read them into a cell-based table view. i was able to populate a single column with the identifier "foo" with the values for "foo", however, that was just by making an array of "foo" items from an SQL query:</p>
  
  <pre><code>FMResultSet *rs = [db executeQuery:@"select * from tbl1"];
      while([foo next]) {
          NSString *thisFoo = [foos stringForColumn:@"foo"];        
          [_foos addObject:[NSString stringWithFormat:@"%@", thisFoo]];
      }
      NSLog(@"Foos: %@", _foos);
  </code></pre>
  
  <p>as a side note, i should be using mutable arrays and mutable dictionaries if i want to update the DB later? or will it not matter, as i would have to query the entire DB to refresh the table view anyway?
  any suggestions on how to populate a three column tableview with a three column sqlite DB are appreciated - as well as corrections to my understanding of FMDB or tableviews. </p>