Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: None  |  size: 1.82 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Get Values form text Fields in UITableView Custom Cell
  2. for (int i=0; iLessThanCounter; i++) {
  3.             
  4.      NSIndexPath *indexPath = [NSIndexPath indexPathForRow: i inSection: 0];
  5.                 
  6.      UITableViewCell *cell = [mytableview cellForRowAtIndexPath:indexPath];
  7.                 
  8.      for (UIView *view in  cell.contentView.subviews){                
  9.                     
  10.            if ([view isKindOfClass:[UITextField class]]){
  11.                         
  12.                   UITextField* txtField = (UITextField *)view;
  13.                         
  14.                   if (txtField.tag == 100) {
  15.                          NSLog(@"TextField.tag:%u and Data %@", txtField.tag, txtField.text);
  16.                   }
  17.                   if (txtField.tag == 101) {
  18.                         NSLog(@"TextField.tag:%u and Data %@", txtField.tag, txtField.text);
  19.                   }
  20.                   if (txtField.tag == 102) {
  21.                         NSLog(@"TextField.tag:%u and Data %@", txtField.tag, txtField.text);
  22.                   }
  23.                   if (txtField.tag == 103) {
  24.                        NSLog(@"TextField.tag:%u and Data %@", txtField.tag, txtField.text);
  25.                   }
  26.                   if (txtField.tag == 104) {
  27.                        NSLog(@"TextField.tag:%u and Data %@", txtField.tag, txtField.text);
  28.  
  29.                   } // End of isKindofClass
  30.               } // End of Cell Sub View
  31.          }// Counter Loop
  32.        
  33. UITableViewCell *cell = [mytableview cellForRowAtIndexPath:indexPath];
  34.  
  35. UIImageView *getImageView = (UIImageView*)[cell.contentView viewWithTag:100];
  36. UITextField *getTextView = (UITextField*)[cell.contentView viewWithTag:200];