views:

36

answers:

2

Hi,

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

+1  A: 

One thing to check would be to make sure that self.tableView is hooked up to the actual table view.

I often forget to do this, and if this is the case, then the reloadData message is not reaching the table view.

Avalanchis
Yes i checked this, the method is called in the TableViewController and the tableView is connected to the Controller, so there is no other tableView which could be connected. Or should i hook the table view on another way up?
Jonathan
ok i solved the problem and know what you mean, sry, i forgot to use the IBOutlet tableView :( thank you
Jonathan
If the problem is solved, please accept one of the answers by clicking the checkbox on the left. I'd suggest accepting jkilbride's answer because he was first and provided more detail on the fix.
Avalanchis
+2  A: 

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.

jkilbride
Thanks, that was my problem, i connected the TableView via an IBOutlet, but i used the self.tableView not the self.myTableView :/ annoying error, thank you:)
Jonathan
No problem glad to help. Could you mark the answer as accepted if it solved the problem completely. Thanks.
jkilbride