App freeze on CoreData save

后端 未结 2 725
一个人的身影
一个人的身影 2021-01-02 09:00

I have an iPhone app that freezes sometimes when saving CoreData and then doesn\'t relaunch. I did have a second thread that uses the database, but I think I have followed t

2条回答
  •  没有蜡笔的小新
    2021-01-02 09:45

    So I now believe the problem was that I was sometimes writing an NSNumber with float value to an integer field. This caused the copy in memory to be different than the copy read from the database, and this caused the infinite merge loop. But if you restarted the app it worked fine because the value was simply an integer from then on.

提交回复
热议问题