Skip to content

Instantly share code, notes, and snippets.

@beelsebob
Created July 27, 2012 20:40
Show Gist options
  • Select an option

  • Save beelsebob/3190377 to your computer and use it in GitHub Desktop.

Select an option

Save beelsebob/3190377 to your computer and use it in GitHub Desktop.
import CoreLocation
# print dir(CoreLocation)
class ShowLocation(object):
"""docstring for ShowLocation"""
def locationManager_didUpdateToLocation_fromLocation_(self, manager, newLocation, oldLocation):
"""docstring for didUpdateToLocation:fromLocation:"""
print "moo" #newLocation, oldLocation
def timerFire_(self, timer)
pass
locationShower = ShowLocation()
loc = CoreLocation.CLLocationManager.alloc().init()
loc.setDelegate_(locationShower)
runLoop = Cocoa.NSRunLoop.currentRunLoop() # Guessing at Cocoa here
timer = Cocoa.NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(24*60*60, locationShower, timerFire_, locationShower, true)
while true
runLoop.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment