I'm pushing a UITableViewController onto a UINavigationController with pushViewController:animated:. I'd like to be notified the moment the animation finishes so I can use selectRowAtIndexPath to scroll to and highlig开发者_高级运维ht a given row.
I know of no way to set the delegate of the push animation. Here's a simple workaround:
Subclass UITableViewController. Override viewDidAppear: to call your "post-animation" method after a short delay.
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self performSelector:@selector(scrollToAndHighlightCurrentRow) withObject:nil afterDelay:0.4];
}
Have you tried simply calling the selectRowAtIndexPath:animated:scrollPosition: method (via the tableView property) before you push it onto the navigation controller's stack?
加载中,请稍侯......
精彩评论