CLLocationManager error

This happened to me while debugging an iphone app with CoreLocation. I got crashes consistently. Then I started paying more attention to the console output, here is the error message:

ERROR,Time,290362745.002,Function,”void CLClientHandleDaemonDataRegistration(__CLClient*, const CLDaemonCommToClientRegistration*, const __CFDictionary*)”,server did not accept client registration 1
WARNING,Time,290362745.005,Function,”void CLClientHandleDaemonInvalidation(__CFMessagePort*, void*)”,client 1035.0 has been disconnected from daemon

That doesn’t make much sense… ^^;

Then I realized I kept saying no to the pop up question “Would Like to Use Your Current Location”. I tried saying “OK”, then everything worked. No more errors.

Well… but not everyone would click ok. How do I get the “Don’t allow” or “OK” response from the user…? I am not sure, let me know if you can find it.

The solution for now though, is to handle this with the didFailWithError callback. Put your error handling code in there to turn off the location manager.

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
  [manager stopUpdatingLocation];

If you’re using MKMapView, set the showsUserLocation property to false.

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
  self.mapView.showsUserLocation = false;

This will stop those errors. Hope this helps!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s