what does this message mean?
NOTICE,A location manager (0xe86bdf0) was created on a dispatch queue executing on a thread other than the main thread. It is the devel
With Swift 3, the following will ensure your function runs on main thread:
OperationQueue.main.addOperation{"your location manager init code"}
It means that if you created a location manager in another thread besides the "Main" thread (i.e., the thread where all the UI code for you app executes), you need to make sure to always call it (i.e., the location manager) from the thread that created it.
To debug the problem in your code, you might want to wrap the creation of (and the calls to )the location manager inside a dispatch queue for the main thread thusly:
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 like that to see if the error message goes away.
You must create the CLLocationManager on a thread with an active run loop, such as the main thread. You should not create it on a background thread. See CLLocationManager Class Reference for more information:
(Configuration of your location manager object must always occur on a thread with an active run loop, such as your application’s main thread.)
If you're interested in what exactly a run loop is, see Run Loops for further information.