Search code examples
iphoneobjective-creloadtableview

reloading table view works just by scrolling outside the visible area


normally, the way to update a tableView is calling self.tableView reloadData (or setNeedsDisplay), but my (visible) tableView doesn't reload by calling this method.

My context is, that I've got a Navigation-Bar and a TableView and by clicking a button on the Navigationbar, the method "aktualisieren" starts. This method also works (i use a UIAlertView to check it) But the Context just updates when i scroll the TableView (after reloading) in the unvisible area (top oder bottom). Then, just the cells which were in the outside area are reloaded. Why? Can anyone helps me?

Thank you very much,

Jonathan


Solution

  • It sounds like your IBOutlet might not be hooked up.

    Check that you have an IBOutlet of type UITableView in your view controller and that its connected correctly to the table that you want to update in Interface Builder.

    If you MyViewController.h file you should have

    IBOutlet UITableView *myTableView;
    
    @property(nonatomic, retain) UITableView *myTableView;
    

    and in interface builder ctrl-drag from the FileOwner (MyViewController) to the table view you want to update and selected myTableView to link it.