swift代码错误cannot convert value of type '([AnyObject]!,NSError!)

图片描述

求大神教我怎么改这个问题,感激不尽。

阅读 4.8k
1 个回答

你的闭包数据类型错了

    let geocoder = CLGeocoder()
//这里 marks: [CLPlacemark]? ,error: NSError?
    geocoder.reverseGeocodeLocation(location, completionHandler: { (marks, error) -> Void in
        //地理位置信息数据处理
    })
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进