Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.section == 0) {
- if (indexPath.row == 7) {
- static NSString *CellIdentifier = @"RevButtonCell";
- RevButtonCell *cell = (RevButtonCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"RevButtonCell" owner:self options:nil];
- cell = [topLevelObjects objectAtIndex:0];
- [cell.revsaveB addTarget:self action:@selector(revaddparse:) forControlEvents:UIControlEventTouchUpInside];
- cell.reveditdeleteB.hidden = YES;
- cell.reveditsaveB.hidden = YES;
- cell.revsaveB.hidden = NO;
- cell.revdeleteB.hidden = NO;
- }
- return cell;
- } else {
- static NSString *CellIdentifier = @"TextCell";
- TextCell *cell = (TextCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TextCell" owner:self options:nil];
- cell = [topLevelObjects objectAtIndex:0];
- }
- cell.detaillabel.text = [revdetailsA objectAtIndex:indexPath.row];
- cell.detailtext.placeholder = @"Enter Text";
- cell.detailtext.tag = indexPath.row;
- cell.detailtext.delegate = self;
- if (indexPath.row == 0) {
- cell.detailtext.text = dateS;
- }
- if (indexPath.row == 1) {
- cell.detailtext.text = clientS;
- }
- if (indexPath.row == 2) {
- cell.detailtext.text = productS;
- }
- if (indexPath.row == 3) {
- cell.detailtext.text = amountS;
- }
- if (indexPath.row == 4) {
- cell.detailtext.text = qtyS;
- }
- if (indexPath.row == 5) {
- cell.detailtext.text = taxS;
- }
- if (indexPath.row == 6) {
- cell.detailtext.text = totalS;
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- }
- }
- - (void)textFieldDidEndEditing:(UITextField *)textField
- {
- [client insertObject:clientS atIndex:0];
- [product insertObject:productS atIndex:0];
- [date insertObject:dateS atIndex:0];
- [amount insertObject:amountS atIndex:0];
- [qty insertObject:qtyS atIndex:0];
- [tax insertObject:taxS atIndex:0];
- [total insertObject:totalS atIndex:0];
- }
- clientS = @"";
- productS = @"";
- dateS = @"";
- amountS = @"";
- qtyS = @"";
- taxS = @"";
- totalS = @"";
- NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%d%d",indexPath.section,indexPath.row];
Add Comment
Please, Sign In to add comment