title: Get all cells In UITableView?
body: <p>I need to get an array of all the cells in my UITableView. I currently use the method below:</p>
  
  <pre><code>-(NSArray *)allTableViewCellsArray
  {
      NSMutableArray *cells = [[NSMutableArray alloc] init];
  
      for (NSInteger j = 0; j &lt; [tableView numberOfSections]; ++j)
      {
          for (NSInteger i = 0; i &lt; [tableView numberOfRowsInSection:j]; ++i)
          {
              [cells addObject:[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:j]]];
          }
      }
  
      return cells;
  }
  </code></pre>
  
  <p>I've had some success with it, however I have come to discover it crashes when a cell isn't visible. So how can I get an array of all the cells in my UITableView regardless as to whether they are visible or not?</p>