views:

74

answers:

1

Hey guys,

I got this really weird bug which is making me crazy:

I push a UIViewController (lets call it tableViewController) which contains a UITableView and therefore conforms to <UITableViewDelegate, UITableViewDataSource> onto another UIViewController (lets call it rootViewController) with:

[self.navigationController pushViewController:tableViewController animated:YES];

The data source is a dictionary with hundreds (up to 1000) of entries. When I scroll down really quick and go back in the navigation hirarchy (pop the tableViewController so that I see the rootViewController) while the uitableview still is animating the scrolling and try to push the tableViewController again quickly, the tableViewController displays correctly (the first rows), but the app does not respond anymore.

Unfortunately I do not get any kind of error message. It just does not respond anymore. It seems to be allright when I wait until the scrolling animation is done. What I think is really weird, is that the app freezes when I try to display the controller again instead of when I pop the tableViewController.

HEY IPHONE PROS OUT THERE - CHECK THIS OUT:

The last four days I tried to fix the bug mentioned above. But how do you want to fix a bug if you dont know whats the bug?! Thats my problem! I dont know whats wrong. So I tried to isolate the problem to a minimum of code.

Weird thing though: The less code I have the less often the bug appears. But, - it still appears. First I thought that my UITableViewController code is to complicated and might cause it somehow. So I made a muchs simpler example app (with a usual UITableViewController) with the basic architecture of my real app. But still no luck.

You can download the sample code here:

sample code

To reproduce the bug, click on the Favourites Tab and then on the Click Me! Button. Then scroll the Table down and while it is still scrolling, navigate back to the Controller with the Click Me Button. Repeat this thirty times. Eventually the app will freeze after the UITableViewController got loaded. If the bug did not appear after 30 times scrolling and going back and forth, just restart the app and do the same thing again. I swear, it will happen! You just need a little patience. It also happens on my iPod. The more complex the app the more often the bug appears.

ATM it seems as if setting animated (self.navigationController pushViewController:vc animated:YES) to NO would fix it. But I am not sure about it yet.

I seriously dont know whats going on here. It might be a stupid thing I did. Maybe in the NIB? I dont know.

THANKS A LOT FOR YOUR HELP GUYS

I hope we can figure it out together. Please check ou the example code

BTW If this happend to anyone before, please let me know and vote for this question

A: 

When you are popping the tableview controller are you unsetting any delegates that may be attached to it's viewController?` I have found this to be the cause of some 'interesting' effects in the past with various components of iOS

Kevin
In the dealloc method I set the datasource and the delegate of the tableview to nil...
jagse