【发布时间】:2017-11-15 07:46:13
【问题描述】:
我正在尝试解析一个 plist。
代码sn-p如下:
if let path = Bundle.main.path(forResource: Constants.plistName, ofType: Constants.plistType) {
guard let myDictionary = NSDictionary(contentsOfFile: path) else {
//throw some error
} }
如果我将 myDictionary 的类型设置为 Dictionary,我将无法再使用 contentsOfFile 方法。 请帮忙。
【问题讨论】: