title: Add selected cell title to NSMutableArray
body: <p>I wrote the code below to add all the titles of a UILabel for each cell in my tableview, however I am not sure how to proceed. I get errors because of the index part.</p>
  
  <p>Thank you in advance</p>
  
  <pre><code>- (IBAction)addAllCellLabelNamesToList:(UIButton *)sender {
      NSMutableArray*selected=[[NSMutableArray alloc]init];
      for (int i =0;i&lt;[_mainTable numberOfRowsInSection:0];i++) {
          ListCell*cell=[_mainTable cellForRowAtIndexPath:i];//not usre what to put here
          if (!cell.isSelected) {//if selected add to array
              [selected addObject:cell.ingredientLabel.text];
          }
      }
  
  }
  </code></pre>