【发布时间】:2017-05-30 23:33:30
【问题描述】:
我在关注struct 时遇到了一些问题:
struct EmployeeDetails {
let functionary: String
let imageFace: String
let phone: String
let latitude: CLLocationDegrees
let longitude: CLLocationDegrees
init(dictionary: [String: Any]) {
self.functionary = (dictionary["Functionary"] as? String) ?? ""
self.imageFace = (dictionary["ImageFace"] as? String) ?? ""
self.phone = (dictionary["Phone"] as? String) ?? ""
self.latitude = (dictionary["Latitude"] as! CLLocationDegrees)
self.longitude = (dictionary["Longitude"] as! CLLocationDegrees)
我没有编译错误,但是当我运行应用程序时,我得到了这个运行时错误:
重要的是要说我正在从 plist 加载数据。谁能告诉我我做错了什么?
编辑:
【问题讨论】:
标签: ios swift mkmapview property-list