Guest User

Untitled

a guest
Jan 16th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  2. {
  3.  
  4. if (indexPath.section == 0) {
  5. if (indexPath.row == 7) {
  6. static NSString *CellIdentifier = @"RevButtonCell";
  7.  
  8. RevButtonCell *cell = (RevButtonCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  9.  
  10. if (cell == nil) {
  11. NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"RevButtonCell" owner:self options:nil];
  12. cell = [topLevelObjects objectAtIndex:0];
  13. [cell.revsaveB addTarget:self action:@selector(revaddparse:) forControlEvents:UIControlEventTouchUpInside];
  14.  
  15. cell.reveditdeleteB.hidden = YES;
  16. cell.reveditsaveB.hidden = YES;
  17. cell.revsaveB.hidden = NO;
  18. cell.revdeleteB.hidden = NO;
  19.  
  20. }
  21. return cell;
  22. } else {
  23.  
  24. static NSString *CellIdentifier = @"TextCell";
  25.  
  26. TextCell *cell = (TextCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  27.  
  28. if (cell == nil) {
  29. NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TextCell" owner:self options:nil];
  30. cell = [topLevelObjects objectAtIndex:0];
  31. }
  32.  
  33. cell.detaillabel.text = [revdetailsA objectAtIndex:indexPath.row];
  34.  
  35. cell.detailtext.placeholder = @"Enter Text";
  36. cell.detailtext.tag = indexPath.row;
  37. cell.detailtext.delegate = self;
  38.  
  39. if (indexPath.row == 0) {
  40. cell.detailtext.text = dateS;
  41. }
  42. if (indexPath.row == 1) {
  43. cell.detailtext.text = clientS;
  44. }
  45. if (indexPath.row == 2) {
  46. cell.detailtext.text = productS;
  47. }
  48. if (indexPath.row == 3) {
  49. cell.detailtext.text = amountS;
  50. }
  51. if (indexPath.row == 4) {
  52. cell.detailtext.text = qtyS;
  53. }
  54. if (indexPath.row == 5) {
  55. cell.detailtext.text = taxS;
  56. }
  57. if (indexPath.row == 6) {
  58. cell.detailtext.text = totalS;
  59. }
  60.  
  61. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  62.  
  63. return cell;
  64. }
  65. }
  66. }
  67.  
  68. - (void)textFieldDidEndEditing:(UITextField *)textField
  69. {
  70. [client insertObject:clientS atIndex:0];
  71. [product insertObject:productS atIndex:0];
  72. [date insertObject:dateS atIndex:0];
  73. [amount insertObject:amountS atIndex:0];
  74. [qty insertObject:qtyS atIndex:0];
  75. [tax insertObject:taxS atIndex:0];
  76. [total insertObject:totalS atIndex:0];
  77. }
  78.  
  79. clientS = @"";
  80. productS = @"";
  81. dateS = @"";
  82. amountS = @"";
  83. qtyS = @"";
  84. taxS = @"";
  85. totalS = @"";
  86.  
  87. NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%d%d",indexPath.section,indexPath.row];
Add Comment
Please, Sign In to add comment