title: plist to tableview when root is array then dictionary
body: <p>I see example and tutorial after tutorial of how to load tableview from plist when root is dictionary but I have to use a plist that is an array. 
  plist setup:</p>
  
  <pre><code>root  Array
     Item 0  Dictionary
           name String
     Item 1  Dictionary
           name String
  </code></pre>
  
  <p>...</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];  
  
      NSString *path = [[NSBundle mainBundle] pathForResource:@"food" ofType:@"plist"];
  
      NSArray *tableData = [[NSArray alloc]initWithContentsOfFile:path];
      NSArray *thumbnails = [[NSArray alloc] init];
  
        for (NSDictionary *dict in tableData){
  
           NSLog(@"%@",dict); // prints all key value pairs in dictionary
  
           thumbnails = [dict objectForKey:@"name"];
  
        }
        NSLog(@"outside %@", thumbnails);  // this prints last value added to thumbnails array 
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *simpleTableIdentifier = @"SimpleTableItem";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
      }
      NSLog(@"%@", thumbnails);  // this loads last value added to array thumbnails
  
      cell.textLabel.text = [thumbnails objectAtIndex:indexPath.row];
  
      return cell;
  }
  </code></pre>
  
  <p>I'm doing this wrong...it doesn't load into my tableview and crashes. I think my for loop is wrong and I think my objectAtIndex is wrong because it crashes at that line. I'm more than happy to share more information. I have datasource and delegate of tableview hooked up to file's owner. I've tested that the tableview works with loading an array directly into it. Please help, I appreciate it.</p>
  
  <p>EDIT:</p>
  
  <p>I placed declaration for the mutable array thumbnails at the top of my .m file as you see below:</p>
  
  <pre><code>@interface SimpleTableViewController ()
  @property (nonatomic, strong) NSMutableArray *thumbnails;
  @end
  </code></pre>
  
  <p>These changes still unfortunately leave me with empty thumbnails array in cellForRowAtIndexPath</p>
  
  <p>Same when @property is placed into .h file</p>
  
  <p>EDIT: .m file (latest code)</p>
  
  <pre><code>#import "SimpleTableViewController.h" 
  
  @interface SimpleTableViewController ()
  
  @end
  
  @implementation SimpleTableViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];   
  
     NSString *path = [[NSBundle mainBundle] pathForResource:@"food" ofType:@"plist"];
  
     NSArray *tableData = [[NSArray alloc]initWithContentsOfFile:path];
     NSMutableArray *thumbnails = [NSMutableArray array];
  
     for (NSDictionary *dict in tableData){
         NSLog(@"%@",dict); // prints all key value pairs in dictionary
        [thumbnails addObject:dict[@"name"]];
     }
         NSLog(@"outside %@", thumbnails);   
  
  // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  
     return 50;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      static NSString *simpleTableIdentifier = @"SimpleTableItem";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault     reuseIdentifier:simpleTableIdentifier];
      }
      NSLog(@"other method%@", self.thumbnails);  // this loads last value added to array thumbnails
      cell.textLabel.text = self.thumbnails[indexPath.row];
  
      return cell;
  
  
  }
  
  @end
  </code></pre>
  
  <p>.h file</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SimpleTableViewController : UIViewController &lt;UITableViewDelegate, UITableViewDataSource&gt; 
  
  @property (strong, nonatomic) NSMutableArray *thumbnails;
  
  @end
  </code></pre>