开发者

iPhone UITableView Leak

Any suggestions on how to work around this UITableView Leak?

Here's a link to a very basic test project that produces the problem:

http://www.maani.us/temp/Test.zip

To reproduce the leak:

  1. Run the project with the "Leaks" performance tool.
  2. In the table view, clic开发者_如何学Pythonk '4' in the right-side Index to jump to section 4.
  3. Scroll up a bit to display a couple of cells from section 3.
  4. Wait for a few seconds. This generates a leak in the instrument.

I tested this both with version 4.2 and 4.3, both with the simulator and a device. All tests produce the leak.

Thank you for you help.


Are you testing this in the simulator or on the device? There are some known leaks with UITableViewControllers in the simulators that do not happen on hardware.

I ran this myself in my the simulator and the only leaks I am getting are for NSIndexPAth and generic 16 byte blocks, both of which are discussed on the internet as being leaked only on the simulator. You can also look at the leaks and see they are created and only accessed within the foundation framework. Therefore, it definitely seems to be a problem with the framework itself. One possible fix for this is to use a UIViewController and setup the UITableView yourself.


The test project above contains only the minimal code necessary to build a UITable and confirm that the leak is in the foundation framework (NSIndexPAth).

Yes, the leak happens on devices too.

The original code used a UIViewController that displayed a UITableView. That too produced a leak. I removed UIViewController to narrow down the problem and confirm that the leak still happens without too.

The only thing that removed the problem is removing the UITable section Index (sectionIndexTitlesForTableView:tableView), which is not a possible option in the final App.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜