8

I am new to iPhone programming. I am looking for an example or a demo on how to use startMonitoringSignificantLocationChanges method with the CoreLocation Manager.

I am confused by the documentation because, I am not sure if the same delegate method is called as in the case of invoking startUpdatingLocation. (i.e. the delegate locationManager: (CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation: (CLLocation *)oldLocation is called)

Any help on this would be appreciated. Also, I am testing it on the simulator by subclassing of CLLocationManager. This subclass provides a simulation of location services when running on the iPhone Simulator. Is there a better way to test this.

Mike
  • 481
  • 10
  • 24

2 Answers2

20

I have done a bit of testing with the significant change API. I posted a sample project on GitHub that lets you play with regular and significant location updates.

This question might also shed some light on what happens when you get woken up for a significant change event.

Update

Another thing you should be aware of, there is a bug in CoreLocation in 4.1. Basically if your app is in the background, then it will crash when core location tries to wake you up. It is fixed in 4.2.

Community
  • 1
  • 1
RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
  • Thanks cannonade! I will check that sample project. – Malolan Santhanakrishnan Oct 13 '10 at 15:06
  • @mark No problems. If you find either of the two answers useful, please vote them up and if a particular answer resolves your issue you can select it as the "accepted answer". Good luck :) – RedBlueThing Oct 13 '10 at 23:32
  • I dont have enough reputations to vote the answer. But I marked the answer as the accepted answer. Thanks again. The sample app was really helpful. Do you have significant experience in working with startMonitoringSignificantLocationChanges? I am asking this because I am newbie trying something ambitious. I am running into issues like this because of limited documentation. – Malolan Santhanakrishnan Oct 14 '10 at 02:17
  • @Mark Yep. I had the same problems (hence the linked question). I was making some progress, but the bug in iOS 4.1 has put a damper on my dev efforts till 4.2 comes out. – RedBlueThing Oct 14 '10 at 08:47
  • I think 4.2 is out now. I mean at least the developer preview. Hope the bug is fixed. – Malolan Santhanakrishnan Oct 14 '10 at 11:43
  • FYI: The URL to the GitHub example project is changed to https://github.com/RedBlueThing/LocationTest – Niels R. Jul 28 '11 at 07:13
1

There is a great video session on these new iOS 4.0 CoreLocation and MapKit features from WWDC 2010 that should be freely available in iTunes U for all registered iPhone developers.

Jason McCreary
  • 71,546
  • 23
  • 135
  • 174