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:
- If I remove one of the other labels from the code (Didn't touch it on IB) then everything works perfectly fine.
- 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.
- I ran it with performance tools with leaks ditection - no leaks.
- 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%...
精彩评论