无法将类型的值“(_) - >()

时间:2019-02-03 03:14:35

标签: swift

我正在为我的项目使用新的视图控制器,并且在其中移动新LabelRow时收到错误消息“无法将类型'(_)->()'的值转换为预期的参数类型'字符串?'”使用尤里卡雨燕4.2 ...任何想法什么可能会造成这个错误,为什么会发生,我该如何解决这一问题?预先感谢!

在问题代码行标记。

类SettingsCacheManagerViewController:FormViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    self.title = "Data Usage"
    self.navigationItem.largeTitleDisplayMode = .never // We do not want large title display on secondary view controllers.

    guard let cachedVideos = SSRSettings.CacheSettings.shared.CurrentCachedVideos else {
        self.form +++ Section(footer: "Downloaded its,s.")
        return
    }

    form +++ Section(footer: "A footer")

这是我想补充一下,但不能添加它:

    Section <<< LabelRow { row in
    let dataConsumptionInMB = Double(SSRSettings.CacheSettings.shared.CurrentDataConsumptionForMonth ?? 0) / 1_000_000.0

    row.title = "Current Period"
    row.value = "\(String(format: "%.2f", dataConsumptionInMB)) MB / \(DATA_COMSUMPTION_HARD_LIMIT / 1_000_000) MB" //100 MB
    {

//////其余代码         }

    let rows = cachedVideos.map { item -> LabelRow in
        let video = allVideos[item.key]!

        return LabelRow(video.id) { row in
            row.title = video.title
            row.value = "\(String(format: "%.2f", Double(item.value.totalBytesStored) / 1_000_000.0)) MB"
        }
    }

    self.form
        +++ MultivaluedSection(multivaluedOptions: []) { section in
           // This needs to be here...
            section.append(contentsOf: rows)
    }
}
}

}

0 个答案:

没有答案