Mikayil Abdullayev
Mikayil Abdullayev

Reputation: 12376

CLLocationManager default coordinate values

I'm learning to develop iOS apps and I try them on simulater only. Now, in my app I use CLLocationManager to get my current location coordinates. But when I run the app no matter where I am I get the same results for all the coordinate values(altitude,longitude,latitude). They do not change even if I move to another location. What I wonder is how does CLLocationManager get values? If it does not work on simulater then where do the values that never change come from? According to the coordinates I guess it's a default value that shows London if no coordinates are available.

Upvotes: 0

Views: 873

Answers (4)

Grant Schweppe
Grant Schweppe

Reputation: 31

On the menu bar, go to Debug, then select Location, Custom Location and then you can input coordinates to simulate from. The Simulator will not always provide you the same feedback as a device would.

Upvotes: 1

Serhii Mamontov
Serhii Mamontov

Reputation: 4932

Simulator may use skyhook to check your location which is bounded to WiFi hotspot (if it was added with it's coordinates) and if you move in radius of WiFi coverage than your location won't be changed at all.

Upvotes: 1

Bushra Shahid
Bushra Shahid

Reputation: 3579

The simulator always gives the location of Apple headquarters at Cupertino. It does not use computer's gps or location.

Upvotes: 1

petershine
petershine

Reputation: 3200

Try Resetting the iOS Simulator, erasing all applications and settings.

And when you run CLLocationManager using application, it will probably ask for permission to use location, something like what you would see in you device.

I've been using iOS Simulator, and it gives location of my computer for the simulator all the time. I guess it's affected by your internet connection and IP address. Since many computers don't come with GPS, it's the only way to know the location of the computer.

Upvotes: 1

Related Questions