TBWord { let randomIndex = Int(arc4random_uniform(UInt3-6ren">
gpt4 book ai didi

ios - "CoreData: error: NULL _cd_rawData but the object is not being turned into a fault"

转载 作者:行者123 更新时间:2023-11-29 01:21:22 24 4
gpt4 key购买 nike

这是发生错误时的代码部分:

class func randomWord() -> TBWord {

let randomIndex = Int(arc4random_uniform(UInt32(TBAppSettings.wordsForCurrentGame.count)))
let word = TBAppSettings.wordsForCurrentGame[randomIndex]

TBAppSettings.wordsForCurrentGame.removeAtIndex(randomIndex)

MagicalRecord.saveWithBlock { context in

let word = TBWord.findWordWithIdentifier(word.identifier, inContext: context) //here error happens
word?.used = true
}

return word
}

我该如何解决这个问题?我知道关于这个问题的其他问题,但它们对我来说还不够。

最佳答案

(除此之外,MagicalRecord 是对如何正确使用 Core Data 的一个很大的误解......)

您是否尝试过使用 -com.apple.CoreData.ConcurrencyDebug 1 作为启动参数来运行代码?这听起来像是线程问题。

关于ios - "CoreData: error: NULL _cd_rawData but the object is not being turned into a fault",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34550694/

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