【发布时间】:2014-07-24 08:30:53
【问题描述】:
我一直在玩 Swift,但遇到了一个问题。 我有以下字典:
var locations:Dictionary<String,CLLocationCoordinate2D> = ["current":CLLocationCoordinate2D(latitude: lat, longitude: lng) ];
println("current locaition is \(locations["current"])")
但编译器抱怨 current 周围的双引号代表我字典中的 a 键。
我尝试使用\ 转义它,但方法不正确。
感谢任何帮助。
【问题讨论】:
-
从
locations["current"]返回的类型不是CLLocationCoordinate2D?作为可选类型吗:developer.apple.com/library/prerelease/ios/documentation/…