开发者

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 UIA开发者_运维知识库lertView 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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜