I'm using the following method to add a new row in m开发者_JAVA技巧y 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?
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.
精彩评论