开发者

A weird problem - adding more UILabels to my UITableViewCell crashes the application when releasing this label

I have a customized UITableView that works just fine. With 4 lables and 3 pictures.

I am trying to add another lablel exactly the same as the others but the app crashes when in my custon UITableViewCell class I try to release it (no matter if I try to release it before the other labels or after)

I tried everything, I got no real progress but I got those wierd results:

  1. If I remove one of the other labels from the code (Didn't touch it on IB) then everything works perfectly fine.
  2. I also tried to add an image view, the same way as in 1 and it works fine too. (I did this to test that I don't maye over allocate to much memory.
  3. I ran it with performance tools with leaks ditection - no leaks.
  4. I created a leak to see if I am consuming all t开发者_JS百科he memory - no problems, I have lots more to spare (couldn't crash it)

HELP!


Your problem probibly relates to the handling of the recycling of UITableViewCells by your UITableView. I don't have the code handy to look at - but the UiTableview function doesn't just assign values to the cell members, but is responsible for properly re-using old cells, and updating it with new content.

99% of the time when people have UITableView crashes - it's related to this. If your using custom UITableViewCells, its probably more like 99.99%...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜