sách gpt4 ăn đã đi

chuỗi - (Swift.LazyMapCollection<>(_căn cứ :[ ]

In lại 作者:搜寻专家 更新时间:2023-11-01 06:19:29 30 4
mua khóa gpt4 giày nike

代码说完全没问题,没有错误,但是当我去运行模拟器的时候,会出现这样的字样:

(Swift.LazyMapCollection < Swift.Dictionary < Swift.String, Swift.String > (_base:[ ]

我正在尝试创建一个显示报价的报价应用。

This is the screenshot with the simulator

这是导入 Plist 的代码:

import Foundation

struct ImportList {
let path: String

init(FileName: String) {
self.path = NSBundle.mainBundle().pathForResource("\(FileName)", ofType:"plist")!
}

var dict: Dictionary {
return NSDictionary(contentsOfFile: path)! as! Dictionary
}

var array: Array {
return [String](arrayLiteral: String(dict.keys) { $0 as String})
}

func count() -> Int {
return array.count
}
}

Cảm ơn.

câu trả lời hay nhất

在这种情况下不要使用arrayLiteral,只需使用Array():

var array: Array {
return Array(dict.keys)
}

它将惰性集合安全地转换为实际数组。

关于string - (Swift.LazyMapCollection<>(_base :[ ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36874973/

30 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress