从注释中获取地址的最佳方法是什么?

时间:2016-05-18 01:39:26

标签: ios swift mapkit

我正在尝试让用户点击注释,在下一个视图中,某些信息(如地址)会在UITextField中显示。但是当试图获取annotation.subtitle时,我得到一个关于MKAnnotation.subtitle返回值为String的错误?而不是我想要的,String。我应该使用reverseGeocodeLocation吗?

1 个答案:

答案 0 :(得分:0)

是的,使用它你会得到一个function generate() { var obj = {}; $('form input').not('[type="submit"]') .each((index, input) => obj[input.name] = input.value); $('#result').text(JSON.stringify(obj)); }对象,包含,名称,地址......

参考:https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLPlacemark_class/index.html#//apple_ref/swift/cl/c:objc(cs)CLPlacemark