CoreLocation in 10.6
I took a really quick look at the built-in location services on Mac 10.6. I wanted to determine what sort of accuracy the feature had out-of-the-box, and what the API looked like.
The code is pretty simple. Just something like:
CLLocationManager* locationManager = [[CLLocationManager alloc] init];
locationManager.delegate               = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
The delagate is just two functions:
- (void)locationManager: (CLLocationManager *)manager
didUpdateToLocation: (CLLocation *)newLocation
fromLocation: (CLLocation *)oldLocation
{
}- (void)locationManager: (CLLocationManager *)manager
didFailWithError: (NSError *)error
{
}
If you put this in your code, you magically get a prompt that looks like this. “Untitled” is the name of my application.
Clicking on the Help icon, you get the following:
The network requests goes to mac-services.apple.com. The good news is that it is over a secure network channel. The bad news is that the content is also hidden from inspection. (eg. since this is close source, Apple could be passing anything. The thing that worries me is that it might be passing the application name which would give unfair Apple insight into what applications are popular).
The accuracy is pretty good — it places me at the building I am working from. Now where is the support for Geolocation in Safari?Â


How about posting a list of 10.6 CoreLocation capable applications?
no idea of who is using CoreLocation, but I would expect many apps to making use of it.
Download my experimental Snow Leopard CoreLocation app “Lucubrator” (with source code) here:.