Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8: -[CLLocationManager requestWhenInUseAuthorization] not calling delegate

I'm calling -[CLLocationManager requestWhenInUseAuthorization] on the main thread. I've set my delegate, and I supplied a value in info.plist for the NSLocationWhenInUseUsageDescription key.

The dialog asking the user for access shows appropriately, but when the user taps "Allow" or "Disallow", the delegate method -[locationManager:didChangeAuthorizationStatus:] isn't being called.

I'm on iOS 8, so it could be a bug...but it seems like too big a bug to go unnoticed. Any ideas what's going on?

Thanks.

like image 878
Greg Maletic Avatar asked Jul 29 '14 00:07

Greg Maletic


1 Answers

Make sure you have a strong reference to the CLLocationManager object. I was having a similar issue and I realized that I never created a property for it.

like image 142
Rick Roberts Avatar answered Sep 29 '22 05:09

Rick Roberts