I don’t know what I’m doing, so all the instructions and the entire Stecoverlof site have climbed. But the error is not corrected. There is no adding a new line up. Inserted beginUpades () and endUpdates () in the code where data is loaded, instead of reloadData (). Guys help, what could be the problem. Here is my code, this is a method for switching a segment from updating data:

@IBAction func btnSegment(_ sender: Any) { tableView.reloadData() } 

insert a new line up (no action takes place):

 func insertRow() { self.soccerString.insert(Soccer(), at: 0) tableView.insertRows(at: [IndexPath(row:0, section: 0)], with: .automatic) } 

Download data from Parse.com server:

 func loadObjects1() { let query = Soccer.query() as! PFQuery<Soccer> query.findObjectsInBackground { (objects, error) in if error == nil { self.soccerString = objects! self.tableView.reloadData() } else { print(error!) } } } 

refresh - updates:

 func obnova() { loadObjects1() loadObjects2() loadObjects3() insertRow() tableView.reloadData() refresh.endRefreshing() } 

The guys will be very grateful for the help and any hint sensible !!!

    1 answer 1

    You have a rather strange code. Instead of adding data to the datasource for your tableView, you try to insert data directly into a table, and then do an update (reloadData), thus erasing your changes.