So I have two view controllers in my iphone project - one of them collects user location data and saves to a file continuously, and the other one does something else (doesnt really matter). I would like to keep the location updates running once the user flips to the other view controller since I am logging and saving to a file his location. How can I k开发者_开发技巧eep running the location updates and file savings while on other view controllers (even if I had more than 2 view controllers total)?
Thanks!
Create an instance of CLLocationManager and start monitoring for location changes (or significant location changes if that works for you). You can create this instance in your AppDelegate or some other class that is unrelated to the view controllers.
精彩评论