This means that if you created a location manager in a thread other than the "Main" thread (that is, a thread in which all the user interface code for your application is executed), you always need to call it (ie a location manager) from the thread that created it.
To debug the problem in your code, you can, for example, wrap the creation (and calls) of the location manager inside the send queue for the main thread:
dispatch_sync(dispatch_get_main_queue(),^ {
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
});
and
dispatch_sync(dispatch_get_main_queue(),^ {
[self.locationManager startUpdatingLocation];
});
Or something similar to see if the error message has disappeared.
Sunny source
share