IPhone custom UITableViewCell Reloading

Posted by Steblo on Stack Overflow See other posts from Stack Overflow or by Steblo
Published on 2010-03-04T14:14:23Z Indexed on 2010/03/09 8:21 UTC
Read the original article Hit count: 455

Filed under:
|

Hi,

currently I'm struggling with this problem: I got a UITableViewController that displays a tableView with different custom cells.

One custom cell displays a number (by a label). If you click on this cell, the navigationController moves to a UIPicker where the user can select the number to be displayes. If the user moves back, the cell should display the updated value.

Problem: I managed to reload the cells by calling

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:animated];
  [self.tableView reloadData];
}

in the UITableViewController.

This works only, if I don't use dequeueReusableCellWithIdentifier for the cell (tables won't show updates otherwise). But in this case, memory usage grows and grows... In addition, the program crashes after about 15 movements to pickerView and back - I think because the cell that should be reloaded is already released.

How can I update a reusable custom cell every time the view appears ? What is the best solution ?

I think retaining cells should not be used ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-management