TableView Cells Automatically reloaded

Discussion in 'iOS Programming' started by rahulvyas, May 10, 2009.

  1. rahulvyas macrumors newbie

    Joined:
    May 6, 2009
    #1
    i have created a new window-based application put a new view on it then put a UItableView on the view using interface builder. then i subclass UITableViewCell class created 3 custom cells without using interface builder.
    now when i delete a cell from the button situated on that custom cell it is deleted but when i scroll down the table cell's re-appear automatically..

    someone knows how to solve this issue?
     
  2. Niiro13 macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #2
    The data source needs to be changed when you delete the cell as well.

    So if your table is based on an array of people objects, then you'd need to remove the person from the array as well, otherwise it will continue to load as the table is basing the content on the array.

    The method deleteRowsAtIndexPath is just for a visual change. It doesn't actually delete it from the data source (which is why Apple's default method override for deleting rows has a comment that says "delete from data source").
     

Share This Page