ios - Stuck in a loop while waiting for -


I have a set of digits, and I will run a calculation where the user can tap a button and the closest to them The point count in the set of works correctly.

My problem now is that I want the button which only calculates, when the accuracy of the device is good for accuracy - under seventy-five meters accuracy, however, I can check the accuracy When I try, I am stuck in the infinite loop, and I do not get any good option for whatever I am trying to do.

Here is my relevant code (and I have tried to do this as a little late {}} while looping {}.

  {NSLog (@ "% f" is located at the current location location); if (urgent copy of current location & lt; 75 & current location. HorizontalAccuracy! = 0) {NSLog (@ "Accuracy is good!") ; CalcDistance.hidden = break; break;} and continue;} while (current location changeable escurcity> current location location change == 0);   

It happens that when I run an app on a device, the total hangs, and the log in the simulator just repeats the accuracy of 0.0000 - I have an NSLog statement in my location manager present Location information should be posted ( NSLog (@ "% @", current location) ), but it will never appear in the log.

My guess is this Loop is coming before any place updates, and then There is stuck and not be able to receive the location information. Some good choices of these loops can do whatever I thought it could easily?

What's happening is that the location update returns to the main run loop, With main run loops are blocked.

You can put that argument on another thread, but I do not advise it.

I suggest inserting a warning with a UIActivityIndicatorView inside it, and waiting until you get the location update with the need for accuracy.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

How to access user directory in lazarus? -

java - Gradle dependencies: compile project by relative path -