UITableView performance degrading after adding subviews on cell iphone sdk
In my application, I'm adding a label and two buttons on cell of UItableView [I have not created a separate cell class]. I'm adding these to cell and not cell.cont开发者_运维技巧entview. After I run my application on IPhone, the tableview cell rendering after I move the cells up-down, is very jerky. Is it because I'm not adding the views on cell.contentView or because I've not created a custom class for cell?
Can anybody please help? Thanks in advance.
Cells are reused so make sure you do it within the if(!cell) {}
block.
Create a parent UIView
that contains your label and buttons. Set cell.contentView
to this parent view.
Ok, the real problem was too many NSLog statements. I removed them, now it works fine. Thanks texmex5, Alex Reynolds and Vladimir for trying to help.
精彩评论