CLLocationCoordinate2D无法实例化 [英] CLLocationCoordinate2D can't be instantiated
问题描述
我正在尝试从我从文件读取的数据中创建一些"CLLocation".第一步是实例化"CLLocationCoordinate2D".送入CLLocation的初始值设定项.我正在操场上尝试我的想法,这个非常简单的代码会生成运行时错误:
I am trying to create some "CLLocation"s from data that I've read from a file. The first step is to instantiate a "CLLocationCoordinate2D" to be fed into the initializer for CLLocation. I'm trying out my ideas in a Playground and this very simple code generates a runtime error:
import CoreLocation
let lat = 48.8
let lon = -122.3
let point2D = CLLocationCoordinate2D(latitude: lat, longitude: lon)
错误消息是
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.
我对Swift编程还很陌生,我不知道该怎么做.例如,我如何使用"线程返回-x""做任何事谁能告诉我这是怎么回事?
I am pretty new to Swift programming and I have no idea what to do with any of this. E.g., how do I "use "thread return -x" " to do anything Can anyone tell me what's going on here?
推荐答案
Frankenstein是正确的-它必须是Xcode错误.我将相同的代码放入真实"代码中程序,没问题.
Frankenstein was right - it must be an Xcode bug. I put the same code in a "real" program and no problem.
这篇关于CLLocationCoordinate2D无法实例化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!