Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Use this delegate method to add a new row below the selected row. And use custom cell to have a text field on it... </p> <pre><code> rowCount ++;//Here rowcount refers the no. of rows in the table. selectedIndexPath = indexPath;//Assign the selected indexpath for creating custom cell on it. [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom];//Indexpath refers the currently selected/targeted cell. </code></pre> <p>In cellforRowAtIndexPath use like this</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if((selectedIndexPath) &amp;&amp; (indexPath.row == selectedIndexPath.row) &amp;&amp; (indexPath.section == selectedIndexPath.section)) { static NSString *cellIdentifier=@"cell"; NewCell *cell = (NewCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { NSString *customeCellName = [NSString stringWithFormat:@"%@",[NewCell class]]; NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:customeCellName owner:self options:nil]; for (id currentObject in topLevelObjects) { if ([currentObject isKindOfClass:[UITableViewCell class]]) { cell = (NewCell *) currentObject; break; } } } [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; return cell; } else { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } cell.textLabel.text = [NSString stringWithFormat:@"%d",indexPath.row]; // Configure the cell... return cell; } } </code></pre> <p>OutPut will be like this <img src="https://i.stack.imgur.com/i1svW.png" alt="enter image description here"></p> <p>need to customize as per your requirement. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload