views:

645

answers:

2

Has anyone written an application that uses the new location API in Mac OS X 10.6? There is a sample program that uses the same API for the iPhone OS, but the API is slightly different for Mac OS X, and Apple provides no sample program using it.

Edit: I know how to use it, the API documentation is ok. It seems overly complex for simple use, but not difficult to understand. On the other hand, I am no XCode expert, so I was wondering if anyone had made any programs using this and might have working sample code to play with.

+1  A: 

An initial examination of the API shows that it works (as far as I can tell) the same as on the iPhone platform, with some minor differences in behavior. One thing I noticed is an OpenRadar bug filed by Dan Wood who states you can't get a location if you're not connected by WiFi. A quick test here (on a wired desktop) responds with the error:

The operation couldn’t be completed. (kCLErrorDomain error 0.)

Could this be the problem you're experiencing?

I don't currently have access to an open WiFi network with which to test further, but I'll update this post if I get a chance.

Joshua Nozzi
+3  A: 

Sample code: WhereIsMyMac, a Snow Leopard CoreLocation project.

jleedev
I really like this, this is exactly what I was going to do for my proof of concept before I actually started using the library.The next thing I need is to figure out how to build bindings for this in FreePascal.
Noah