0

I followed the instructions in: How to get Location user whith CLLocationManager in swift? and I was able to get the coordinates in my iPhone but not in the emulator. once I run the app in the emulator I get the following error:

Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"

The sample code in the previous link is showing how to get the coordination within the AppDelegate file.

As I am a beginner in iPhone development, I couldn't retrieve coordinates in the viewController.

I would like to keep the app notified as the mobile is moving and the coordination is changed and need to calculate how far (kilometers or miles) the mobile from a specific location (fixed coordination).

Any help?

Community
  • 1
  • 1
IoC
  • 287
  • 2
  • 5
  • 10

2 Answers2

0

There is a known issue in beta 5 with location and the simulator.

Check the release notes issue - 17858614

Woodstock
  • 22,184
  • 15
  • 80
  • 118
  • Ok, I could keep testing with my mobile, any help in keeping my app updated with real location all the time? – IoC Aug 08 '14 at 05:58
  • 1
    @loC if you're frustrated by the GPS taking too long to "warm up" with an initial location fix while indoors/with bad signal, I suggest installing a GPS app such as `MotionX GPS` and having it record a track in the background while you're doing development. That will keep the GPS active in the background ensuring the GPS hardware is always active. – Abhi Beckert Aug 08 '14 at 06:00
  • @loc, how do you mean updated in realtime do you mean moving about? – Woodstock Aug 08 '14 at 06:05
  • I mean that the application will show how far or close you are from a fixed position as you are moving. For example: showing the distance between you and your office. – IoC Aug 08 '14 at 07:06
0

on the iOS simulator under Debug menu, change location from Apple to something like City Bicycle Ride and give it a run.

Tarek
  • 1
  • 1