本文介绍了返回Mapkit用户定位坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试返回当前位置的经/纬度坐标时,我的应用程序就会崩溃,并且没有错误说明...

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...

推荐答案

mapView.userLocation.location.coordinate是一个结构,而%@格式说明符期望一个对象.这将起作用:

mapView.userLocation.location.coordinate is a struct while the %@ format specifier expects an object. This will work:

NSLog(@"%f, %f", mapView.userLocation.location.coordinate.latitude,
                 mapView.userLocation.location.coordinate.longitude);

这篇关于返回Mapkit用户定位坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 15:20