开发者

Could a memory leak cause problems with UITableView scrolling?

开发者 https://www.devze.com 2023-02-19 20:29 出处:网络
I have a program based on UITableView (the user can edit the contents of the cells).After a long time open (mostly in the background) it will sometimes suddenly stop allowing you to fully scroll to th

I have a program based on UITableView (the user can edit the contents of the cells). After a long time open (mostly in the background) it will sometimes suddenly stop allowing you to fully scroll to the bottom of the list. The scroll is set to bounce, so it will bounce up and you can see the last few rows, but it will bounce right back down and hide them again.

I am using the navigation controller's toolbar, so in some ways it seems like the toolbar hides the last few items, but I think that's not really what's going on. (I think the last item or two would be off the screen anyway.)

Again, there is no problem scrolling most of the time.

It happens so rarely that I haven't been able to get very close to identifying the cause. It seems like it might happen after rotating to landscape mode, but many many rotations can occur without causing the problem. It also seems to show up after my phone has gone well below 10% battery before being recharged (I notice the problem after the battery is back to full, but it could be it starts before that, or that the battery status is totally unrelated).

Since it happens after the program has been running for days (mostly in the background) and is fixed by restarting the phone, I have suspected a memory leak, but I don't get any memory warnings and the program runs normally otherwise, even when the scrolling开发者_JAVA技巧 stops behaving correctly.

I have run Leaks a few times, and only once found a 16 byte leak on exiting the program, which I haven't been able to reproduce.

Any thoughts would be deeply appreciated.


Leaks wouldn't cause such problems by themselves. Sounds like your table gets resized, either automatically with UIViewAutoresizingFlexibleBottomMargin/UIViewAutoresizingFlexibleHeight resizing mask or manually.

0

精彩评论

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