在我的应用程序中,我在 UITabBarController 中嵌入了三个 View Controller 。第二个 View Controller 嵌入了一个 TableView Controller 。现在我有这个错误:我转到第二个 View Controller ,然后我按下主页按钮,应用程序进入后台。当应用程序关闭时,我会收到推送通知,所以当我打开应用程序时,它会显示第二个带有 TableView 的 View Controller ,没有任何更改。如何自动更新表格 View ?现在我正在使用 UIRefreshControl
,但我会自动执行它,我该怎么做?
最佳答案
您可以从 Storyboard 中获取 VC 的实例。首先你必须为你的 VC 设置 Storyboard ID
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
YourViewController *vc = [storyBoard instantiateViewControllerWithIdentifier:@"YourViewControllerID"]; // here YourViewControllerID is storyboard Id of your VC.
关于ios - 在 AppDelegate.m 中获取 View Controller 的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28363455/