2
votes

I'm using iOS SDK7.1.

In my view controller's viewDidLoad method I create a CLLocationManager object and send it the startUpdatingLocation method.

In the iOS Simulator, I can change the location, and the locationManager:didUpdateLocations gets called.

However, it does not seem that locationManager:didUpdateLocations is called immediately after CLLocationManager object receives the startUpdatindgLocation method.

In the documentation for startUpdatingLocation in CLLocationManger it says: Calling this method causes the location manager to obtain an initial location fix (which may take several seconds) and notify your delegate by calling its locationManager:didUpdateLocations: method.

Basically, I want to get the user's location before the user moves.

1
You really want to be testing core location on a physical device, not in the simulator. Also keep in mind GPS functions better when it has a clear view of the sky... so some testing will have to be done outside rather than at your desk. Very annoying but there's no way around it.Abhi Beckert
I thought that the location services might use the WiFi to determine location if I was indoors and using the iOS simulator.user3731622

1 Answers

1
votes

You must set:

NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription

In your info.plist