简体   繁体   中英

How do I refresh a table view from a separate uiviewcontroller?

In my project I have two view controllers one that lists all the core data stored in a table view and a second that allows the user to input data to be stored. However when I click the back button on the navigation controller on the second it fails to refresh the tableView .

I have tried [self.tableView reloadData] in the viewDidLoad as a bit of a long shot but no joy.

How would i go about refreshing the data when the user clicks back?

Many thanks Danny

最短的路线是将[self.tableView reloadData]viewDidLoad移到viewDidAppear但我建议使用委托或回调,以便仅在必要时重新加载。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM