开发者

Executing callback after insertRowsAtIndexPaths

开发者 https://www.devze.com 2023-02-01 03:34 出处:网络
I\'m using the following method to add a new row in m开发者_JAVA技巧y table: [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消