after hours of search I need your help. I have setup a program for iOS showing recipes of my private cooking book. The recipes are stored in a json file on my web server. I use another application on my MAC to update the recipes in this json file and to store it on my web server. Unfortunately the updated recipes are not shown in my iOS-application. The iOS-app shows always the old data - I guess they are stored locally on my iPhone/iPad after the first installation of the app?
How can I enforce that at every launch of the iOS-app on my iPhone/iPad the actual json data from the web server are used and not the old one.
I retrieve the data via this function I call from the viewDidLoad() and before the reloadData() of the UITableView showing the titles of the recipes
func initKochbuch() {
let url = URL(string: selektiertesKochbuch)!
let urlSession = URLSession.shared
let task = urlSession.dataTask(with: url) { (data, response, error) in
guard let data = data else {
debugPrint("Fehler beim Laden", error ?? "Unbekannter Fehler")
return
}
self.kochbuch_local.rezepte = try! JSONDecoder().decode([Rezept].self, from: data)
self.initRezeptAnsicht()
OperationQueue.main.addOperation {self.tableView.reloadData()}
}
task.resume()
}
What do I have to do in addition? Thanks for your support.