【发布时间】:2017-04-22 01:31:15
【问题描述】:
if let name = property["Name"] as? String,
let latitude = property["Latitude"] as? NSNumber,
let longitude = property["Longitude"] as? NSNumber,
let image = property["Image"] as? String {
// To learn how to read data from plist file, check out our Saving Data
// in iOS Video Tutorial series.
// Code goes here
}
当我将我的代码转换为当前的 swift 版本时,我面临“键入任何没有下标错误”。我对 swift 还很陌生,并且停留在这一点上。看到其他相关帖子,但我找不到解决方案。请帮忙。
【问题讨论】:
-
Edit 您的代码显示了如何声明和初始化
property。 -
当然你的答案可以在these search results中找到。