How can I speed up a UITableView?

前端 未结 9 1911
广开言路
广开言路 2020-12-22 23:17

I have a UITableView with about 400 cells in 200 sections and it\'s a little sluggish in responding to user interaction (scrolling, selecting cells.) I\'ve made sure the met

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 23:41

    Just note these points..

    1. Are you reusing the cells..Which is a good practice to do..
    2. Make sure you are not doing any expensive calculations in cellForRowAtIndexPath callback, or in a function called from CellForRowAtIndexPath..
    3. You said there is a background image. Another reason that you must reuse your cell.

    Some good info about cell reuse is here..

    EDIT : Found this page very late..

    This SO question thread might help you...especially the accepted answer...

提交回复
热议问题