The first query that my app performs is slow to respond when using an iOS device. When using the iOS simulator the response is immediate. The query returns 6 rows of 5 columns, 4 short strings and 2 numbers. All the preceding queries return almost immediately even though they are returning more data.
Any ideas on why this is happening or any suggestions to improve the response of the first query.
My query looks like this
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
From the backend perspective there is nothing special about the first query, it is executed the same way as any other one. Could you check if perhaps removing the following line would make any difference?
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
I was able to solve this by moving the query to a function that gets called after the “ViewDidLoad” function. iOS seems to be blocking the query and slowing it down. This was not an issue with Parse. I tried calling the query before the “ViewDidLoad” function but that was also slow.
In my case I needed to wait for the location manager and map to load and then perform the query. Moving the query fixed the problem, I had to try a couple different locations before I found one that worked.
I am using the asynchronous version of the API. I was able to solve the issue by moving the code to a different function and it didn’t impact the functionality of my app.