1
我有一個帶有一些刷新代碼的表格視圖應用程序(如下所示)。我也啓用了我的Main.storyboard
。UIRefreshControl不能正常工作
override func viewDidLoad() {
super.viewDidLoad()
self.refreshControl?.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)
}
func refresh(refreshControl: UIRefreshControl) {
tableView.reloadData()
refreshControl.endRefreshing()
}
當我在我的應用程序中進行刷新時,表視圖不會刷新其JSON數據。我該如何解決?我正在使用UITableViewController
,而不是UITableView
。
你需要真正去到你的服務器,並獲得新的數據,當您刷新 – dan
@丹如何我會去做這個嗎? –
你如何獲得數據來填充你的tableView? – Larme