返回 Mapkit 用户位置坐标
每当我尝试返回当前位置的纬度/经度坐标时,我的应用程序就会崩溃,并且没有任何错误解释...
NSLog(@"%@", mapView.userLocation.location.coordinate);
我正在等待手机也找到该位置...
whenever I try to return the lat/long coordinates for my current location, my application crashes with no explanation of the error...
NSLog(@"%@", mapView.userLocation.location.coordinate);
I am waiting until the phone finds the location as well...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
mapView.userLocation.location.cooperative
是一个结构体,而%@
格式说明符需要一个对象。这将起作用:mapView.userLocation.location.coordinate
is a struct while the%@
format specifier expects an object. This will work:由于某种原因,这对我不起作用。它带我到坐标 (0.0000, 0.0000)。下面是我的代码,如果您有机会查看一下。感谢您的帮助!
For some reason, this didn't work for me. It's taking me to the coordinates (0.0000, 0.0000). Below is my code if you have a chance to check it out. Thanks for the help!