gpt4 book ai didi

swift - Swift 3 中的 NSFetchedResultsController deleteCache

转载 作者:IT王子 更新时间:2023-10-29 05:41:15 26 4
gpt4 key购买 nike

目前正在迁移到 swift 3 并且无法完全弄清楚解析器想要什么 NSFetchedResultsController.deleteCache(withName: "rootCache")

使用这种语法,我得到了“Type 'String?'”构建时不符合协议(protocol)“ExpressibleByStringLiteral”错误。

最佳答案

错误信息具有误导性。从 swift 3 开始,NSFetchedResultsController 是泛型

open class NSFetchedResultsController<ResultType : NSFetchRequestResult> : NSObject { }

以下应该有效:

NSFetchedResultsController<NSFetchRequestResult>.deleteCache(withName: "rootCache")

关于swift - Swift 3 中的 NSFetchedResultsController deleteCache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39517493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com