Jaka Jančar
Jaka Jančar

Reputation: 11596

scrollsToTop not working

I have the following object structure:

It used to work, but then I added the UITabBarController into the mix and made a bunch of other large changes and somewhere in between it stopped.

So far I have:

One thing that might be of use is that -scrollViewShouldScrollToTop: isn't even being called, even though the table view controller's tableView.delegate is set to the controller.

Upvotes: 5

Views: 3917

Answers (2)

JFK
JFK

Reputation: 29

I added following line to UITableViewController.

[self.navigationController.parentViewController.view.window makeKeyAndVisible];

Upvotes: 1

T .
T .

Reputation: 4944

Just came across this problem myself.

If, like me, you started from the tab bar template Apple provides, then you have to add the following line to applicationDidFinishLaunching: in your app delegate:

[window makeKeyAndVisible];

This one line is what fixed it for me.

Upvotes: 7

Related Questions