TableView stle1 not displaying properly

Discussion in 'iOS Programming' started by satyam90, Dec 4, 2009.

  1. macrumors regular


    Jul 30, 2007
    Bangalore, India
    I have a table view. only one cell will have style1 cell and remaining all cells are default cells.
    For style1 cell, I am displaying detailed text along with accessory.
    Its compiling and staring the app well.
    But when I scroll table veiw up/down, the detailed text is being shown in a different cell. i'm attaching the code as attachment.
    can some help me in fixing this.


    Attached Files:

  2. Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    The problem is when cell != nil, it's reusing a previously created cell, one that already has its style set. So, when row 0 goes offscreen, row 11 (labelled 12) grabs that cell out of the queue to use for itself, but since it didn't need to create it, it won't set the style.

    EDIT: You may want to consider using a couple of different CellIdentifiers as part of your reuse strategy.

Share This Page