CLLocationCooperative2D 无法实例化

gee*_*ker 5 runtime core-location cllocationcoordinate2d swift

我正在尝试根据从文件中读取的数据创建一些“CLLocation”。第一步是实例化一个“CLLocationCooperative2D”,将其输入到 CLLocation 的初始化程序中。我正在 Playground 中尝试我的想法,这个非常简单的代码会生成一个运行时错误:

import CoreLocation

let lat = 48.8
let lon = -122.3
let point2D = CLLocationCoordinate2D(latitude: lat, longitude: lon)
Run Code Online (Sandbox Code Playgroud)

错误信息是

error: Execution was interrupted, reason: signal SIGABRT.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
Run Code Online (Sandbox Code Playgroud)

我对 Swift 编程还很陌生,我不知道如何处理这些。例如,我如何“使用“thread return -x””来做任何事情谁能告诉我这里发生了什么?

我尝试附上整个游乐场的照片,但不知道是否可行

Sah*_*hey 12

刚刚发生在我身上。尝试替换import CoreLocationimport MapKitm\xd1\x83 情况下有效的内容。

\n


gee*_*ker 2

弗兰肯斯坦是对的——这一定是 Xcode 的 bug。我将相同的代码放入“真实”程序中,没有问题。