I am writing an iPhone app and using Location Services. I am using the startMonitoringSignificantLocationChanges
method on CLLocationManager
. (As I understand, this is for low power, low accuracy location services.) When I build and launch my app in iOS Simulator, it gets my location fine. However, I want to simulate updates to the location beyond the initial fix.
I did notice these two options:
- iOS Simulator : Debug > Location menu
- Xcode 4: Product > Debug > Simulate Location menu
Both of these work acceptably for simulating an initial fix. (For example, choose 'Apple' from the former, or 'Moscow' from the latter.) However, subsequent changes to either of these will NOT trigger another location update in the simulated app.
What I desire is to be notified when the simulated location changes when using startMonitoringSignificantLocationChanges
. (iOS Simulator does generate a series of updates when I use startUpdatingLocation
instead.) This makes it way easier to test location-enabled applications without taking the device out into the field.
Two questions:
- What is the difference between these two?
- How do I use iOS Simulator and/or Xcode 4 to simulate a series of location changes?
Cheers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…