Hi
I have this code in a login view, the user enters username and password and then clicks the login button at which point I run this code
self.DataManager = [[DataManager alloc] fetchTillConfigObject: tillID];
[self.navigationController pushViewController:mainMenu animated:YES];
fetchTillConfigObject calls a webservice using NSURLSessionDataTask to authenticate the user and to download a small JSON object that I am saving in NSUserDefaults
My problem is that sometimes if the network is slow the mainMenu gets pushed before the webservice returns an answer.
I need to make sure that the fetchTillConfigObject finishes before the mainMenu gets pushed at all times as the values it downloads is critical for further usage in the application so I have to gurantee it is done before showing the mainMenu
Any guides much appreciated
Matt