开发者

Executing callback after insertRowsAtIndexPaths

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜