Search code examples
uitableviewviewreloadtableview

UITableView returning from a detail view and updating mainview cell HELP


So i drill down from main view (which is populated by an APPDelegate array) into a detail view. In that view i can edit the app Delegate array, which i do, then when i return my cell is the previous value not the new value. i use

- (void)viewWillAppear:(BOOL)animated

{
    [super viewWillAppear:animated];
    [[self mainTableView] reloadData];      
}

But on appearance it's not updated, but as soon as the cell gets recycled (ie. scroll up then down) it appears fine. I think it's just late and im missing something simple.... wop wop woaaaaa


Solution

  • I wrote my own refresh-methode and call it by myself before I pop or push the UIViewController:

    - (void)reset {
        // refresh:
        UITableView *tableView = (UITableView *) self.view;
        [tableView reloadData]; 
    }