非常惊讶地看到以下错误:
undefined method `[]' for #<CLLocation:0x9a95cd0> (NoMethodError)当试图复制给出的最简单的示例时:
BW::Location.get_once do |result|
p "From Lat #{result[:from].latitude}, Long #{result[:from].longitude}"
p "To Lat #{result[:to].latitude}, Long #{result[:to].longitude}"
end使用以下方法导入CLLocation (即使在使用冒泡包装时不确定它是必需的):
app.frameworks += ["CoreLocation"]鼓泡包装的位置是:
require 'bubble-wrap/location'任何明显的认识(:
发布于 2014-03-17 17:31:48
BW::Location.get_once生成一个CLLocation对象,而不是一个CLLocation数组。
试着做这样的事情:
BW::Location.get_once do |location|
p "Lat #{location.latitude}, Long #{location.longitude}"
endhttps://stackoverflow.com/questions/22459853
复制相似问题