Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HARDWARRIOR

macrumors member
Original poster
Nov 17, 2008
52
0
I want to make non-GUI application that in background collects gps location every 5 mins.

I know how to make non-GUI app: just remove UIApplicationMain from main.m of ViewBased template an insert my code there. Such a app I can make to load at boot by creating a plist file in /System/Library/LaunchDaemons/
But CLLocationManager can not call CLLocationManagerDelegate's selectors without UIApplicaiton (see attached screenshot of call stack)

So how can I make desired app? May be there is a way to collect gps data without CLLocationManager e.g. just by calling some func. Or is there a way to replace UIApplicaiton with non-UI message runloop?

PS this app is not for appStore, it is for jailBroken devices
 

Attachments

  • LocationDisplay - Debugger-1.jpg
    LocationDisplay - Debugger-1.jpg
    131.7 KB · Views: 136

indiekiduk

macrumors 6502
Jul 26, 2005
478
408
Glasgow, Scotland
It works if you use a CFRunLoop in your application. What is very weird is it works in a command line app but not in a daemon. The error is:

CLClientHandleDaemonDataRegistration: server did not accept client registration 2

Why would that be?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.