I am using CLLocationManager
, if the program is installed for the first time, it requires user to accept or deny to share his location. What I want is to program itself to wait until user prompts.
Now the issue is I am waiting there with usleep()
while ([CLLocationManager authorizationStatus] == USER_NOT_PROMPTED) {
usleep(10000);
}
But this causes the actual iPhone to be locked in a way that the location sharing question does not pop up, therefore the program hangs. Is there a way to run those user prompts in a separate thread? I am using iOS 6.1