Question

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.

I read the API and understand how it works, it's actually using it easily from FPK that is the issue. I am looking for any sample code for someone who has implemented access to it in FreePascal (i.e. it should be Possible by using ObjectivePascal, but that is not my area of expertise). I also considered just writing a wrapper in normal X-Code/ObjC which would make a normal .SO file I could link to to get what I want in FreePascal.

I also noticed there is a locationd running, so maybe there is a more normal Unix-like API that can be used instead of the Cocoa method.

Was it helpful?

Solution

Sample code: WhereIsMyMac, a Snow Leopard CoreLocation project.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top