1
votes

I'm seeing a noticeable UI freeze occasionally when calling [CLLocationManager authorizationStatus] on the main thread for some older devices. Should this be happening? I don't see anything in the documentation indicating this is any more than a get on a status variable

Documentation: https://developer.apple.com/library/mac/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/clm/CLLocationManager/authorizationStatus

Issue apparent on iPhone 4S running iOS 7.0.4

1
Did you ever find a solution for this issue (besides dispatching to a background thread)? - bcherry
No, I've moved it to a background thread for now. Hoping a fix will be available soon. - Mike

1 Answers

0
votes

I had the same problem. I still don't know what the reason for this is, but my quick solution was to put it into a thread like this:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
        // Do something...
    }
});

I hope this helps.