title: iOS 7 - Take the value of a textField inside a custom tableViewCell from another function
body: <p>Sorry if the title is not clear. I have an application that shows a tableView and the user selects several rows and inputs text in the textField in the tableViewCell. After that, he presses a button to submit his selections together with the his input in the textField. </p>
  
  <p>Here is <code>SearchResultTableViewCell.h</code></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SearchResultTableViewCell : UITableViewCell
  
  @property (strong, nonatomic) IBOutlet UILabel *price;
  @property (strong, nonatomic) IBOutlet UILabel *itemName;
  @property (strong, nonatomic) IBOutlet UILabel *discount;
  @property (strong, nonatomic) IBOutlet UITextField *quantity;
  @property (strong, nonatomic) IBOutlet UITextField *discountInput;
  
  @end
  </code></pre>
  
  <p>And here is my <code>cellForRowAtIndexPath</code> method.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *ItemCellIdentifier = @"CellIdentifier";
      SearchResultTableViewCell *tableCell =(SearchResultTableViewCell *)[tableView dequeueReusableCellWithIdentifier:ItemCellIdentifier];
  
      //set text labels here --&gt; The values are taken from arrays
      [tableCell.price setText:[NSString stringWithString:[priceList objectAtIndex:indexPath.row]]];
      [tableCell.itemName setText:[NSString stringWithString:[itemNameList objectAtIndex:indexPath.row]]];
      [tableCell.discount setText:[NSString stringWithString:[discountList objectAtIndex:indexPath.row]]];
      [tableCell.quantity setKeyboardType:UIKeyboardTypeDecimalPad];
      [tableCell.discountInput setKeyboardType:UIKeyboardTypeDecimalPad];
  
      tableCell.itemName.numberOfLines = 0;
      tableCell.itemName.lineBreakMode = NSLineBreakByWordWrapping;
  
      //set check mark and highlights.
      if ([[checkList objectAtIndex:indexPath.row] integerValue] == 1){
          tableCell.accessoryType = UITableViewCellAccessoryCheckmark;
          [tableView selectRowAtIndexPath:indexPath
                                 animated:YES
                           scrollPosition:UITableViewScrollPositionNone];
  
      }
      else{
          tableCell.accessoryType = UITableViewCellAccessoryNone;
          [tableView deselectRowAtIndexPath:indexPath animated:YES];
      }
  
      return tableCell;
  
  }
  </code></pre>
  
  <p>My issue lies in accessing the textField input from my own function. Here is my function so far:</p>
  
  <pre><code>-(void)prepareFinalArray{
      //these are the arrays where I save the selection
      itemNameListFinal = [[NSMutableArray alloc] init];
      priceListFinal = [[NSMutableArray alloc] init];
      discountListFinal = [[NSMutableArray alloc] init];
      discountRequestListFinal = [[NSMutableArray alloc] init];
  
      //use this array to know which positions the selected items are
      NSMutableArray *selectedItems = [[NSMutableArray alloc] init];
  
      //loop at the checkList. My checkList array tracks which rows are selected.
      for( int i = 0 ; i &lt; [checkList count] ; i++ ){
          if( [checkList[i] isEqualToString:@"1"] ){
              NSNumber *currentElement = [NSNumber numberWithInteger:i];
              NSLog(@"Selected item detected at %d,", i);
              [selectedItems addObject:currentElement];
          }
      }
  
      //Now that we have the index paths, get the itemNames, discount, user input qty, and user input discount.
      for( int i = 0 ; i &lt; [selectedItems count] ; i++){
          //now that I have the indices of the selected items, I get the value from my 
          //itemNameList and discountList arrays, these arrays were used to populate the tableView
          [itemNameListFinal addObject:itemNameList[[[selectedItems objectAtIndex:i] integerValue]]];
          [discountListFinal addObject:discountList[[[selectedItems objectAtIndex:i] integerValue]]];
  
          //This is my problem so far, what I want to do next is to access the tableViewCell
          //and their quantity and discountInput properties (the textFields)
          //so far, I managed to get the cell for row at a certain index path
          //I do not know how to proceed after this. 
          //[self.searchResults cellForRowAtIndexPath:[[[selectedItems objectAtIndex:i] integerValue]].row];
      }
  }
  </code></pre>
  
  <p>I do not know how to proceed after this: </p>
  
  <p><code>[self.searchResults cellForRowAtIndexPath:[[[selectedItems objectAtIndex:i] integerValue]].row];</code></p>
  
  <p>I do not know how to access the <code>quantity</code> and <code>discountInput</code> properties once I have the row (assuming that I managed to get the row properly in the code above) and I'm not also sure on how to get the input text from them. Can anyone help me? Sorry if what I want to do is too tedious. </p>
  
  <p>Thank you in advance for the help.</p>