gpt4 book ai didi

ios - NSCoding 和 Bools Swift 3

转载 作者:搜寻专家 更新时间:2023-11-01 06:18:10 25 4
gpt4 key购买 nike

无论出于何种原因,我的应用程序每次解码我的 Bool 值时都会崩溃。在我更新到 Swift 3 之前它没有崩溃。我不知道我做错了什么。如果我取出 Bool 值,我的应用程序运行良好而不会崩溃。 enter image description here

最佳答案

这已针对 Swift 3 进行了更改。各种不同类型都有关联的 decode...() 函数。

现在正确的语法是:

let myBool = aDecoder.decodeBool(forKey: PropertyKey.completedKey)

关于ios - NSCoding 和 Bools Swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39756235/

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