Slow TableView with Custom Cells

Discussion in 'iOS Programming' started by donaghy, Nov 5, 2010.

  1. donaghy macrumors member

    Aug 6, 2009
    Hi all,

    I've created a data entry form using a table view with custom cells. My custom cells are simple cells that contain a label and a textfield or textview. Though i find my table is very slow and "sticky" when scrolling. Is this typical or is there a better working solution for something like this?

  2. Sykte macrumors regular

    Aug 26, 2010
    Code will help. Are you using DequeueReusableCell? What do you mean by custom cells, this could mean many things.
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Some reasons are

    images in the cells, especially loaded from a remote source,
    loading data from a database, slowly
    loading the cells from nibs,
    other complicated drawing in the cells,
    use of UITextViews in your cells
    variable height rows
    creating a new cell every time
  4. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Don't forget non-opaque subviews! :)
  5. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Right, I think using clearColor as the background color is supposed to slow things down too.
  6. donaghy thread starter macrumors member

    Aug 6, 2009
    Ok i am loading cells from nibs and using textfields and textviews. I'll try creating the cells programmatically and see if that has any improvement.
  7. bredell macrumors regular

    Mar 30, 2008
    Uppsala, Sweden
    The most important thing is to reuse your table cells. If you have complex cells with lots of info it's probably a good idea to create a custom UIView subclass and do all the drawing yourself.

    The WWDC videos have a session on how to improve your table view performance.
  8. mmcc macrumors regular

    Nov 8, 2010
    Does anyone have a pointer to a good reference (or WWDC video) of how to use InterfaceBuilder with UITableView?

    It seems I can do very little to create/format cells in a UITableView via IB. I was hoping for more visual control in this area as iOS matures. There is a UITableCell visual item in IB, but I can't find much info on how to use it. It seems all the Apple examples create all sections/cells in code rather than visually in IB. I am so sick of that default list that is displayed in IB (California, etc.)! :eek:


Share This Page