How to get notified when a tableViewController finishes animating the push onto a nav stack

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 highlight a given row. How can I set the delegate of an animation I didn't call explicitly?

Answers


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?


Need Your Help

How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain

java android ssl

I'm writing an Android app that requires SSL client authentication. I know how to create a JKS keystore for a desktop Java application, but Android only supports the BKS format. Every way I've trie...

Need to verify address of a user in iphone

iphone xcode mkmapview

I need to verify the address entered by user in my app .What basically i need is how to veriry the address entered by the user suppose user enters the address like 7 Breezeland Road, Carpentersvill...