2

I have UITabBarController with two tabs. Each tabs have UITableViewController which view data from database.

When I change data and switch tab view doesn't change. When I back and switch tab again, view is ok!

How can I renew view programmatically?

Erkam KUCET
  • 485
  • 8
  • 21
Walter West
  • 829
  • 3
  • 12
  • 31

2 Answers2

3

You need to call <tableview>.reloadData(). That will tell the table view to get the new count and fetch the displayed rows once again.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
3

Need to fetch data in viewWillAppear, don't in viewDidLoad. Thank you Matthias Bauch!

Walter West
  • 829
  • 3
  • 12
  • 31