userLocation: latitude/longitude return zero?

前端 未结 2 1592
执笔经年
执笔经年 2021-01-28 18:23

I am just looking at mapKit and decided to make a quick button to display my current location, however when I press the button my latitude/longitude always display as [0.000000]

2条回答
  •  长情又很酷
    2021-01-28 18:56

    [...] as I can see the map on the simulator [...]

    Test it on the device. By default, on the simulator, the coordinates you get back are Apple's headquarters. Cf. doc.

    See this other SO question for workarounds and useful utilities : Testing CoreLocation on iPhone Simulator

提交回复
热议问题