2

I'm using the following method to add a new row in my table:

[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];

However I would like to execute another function after this has finished and the row is effectively present in the table. Is this possible to do?

Oscar Del Ben
  • 4,485
  • 1
  • 27
  • 41
  • This is a duplicate of this question which has a more correct answer: http://stackoverflow.com/questions/3832474/uitableview-row-animation-duration-and-completion-callback – Ken M. Haggerty Mar 17 '16 at 22:15

1 Answers1

2

I solved this problem as described here with a callback:

[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];

            [self performSelector:@selector(showKeyboard:)
                                 withObject:newIndexPath
                                 afterDelay:0.5];

There may be a better way though.

Community
  • 1
  • 1
Oscar Del Ben
  • 4,485
  • 1
  • 27
  • 41