Core Data mishandles NSCFBoolean?

寵の児 提交于 2019-12-07 07:38:25

As far as Core Data is concerned a Boolean is just a NSNumber with its values limited to 0 or 1. Core Data expects the receiving controller and/or view code to display it properly.

However, since you are subclassing NSManagedObject anyway, then I would suggest writing a includeInHistoryValue methods that do the boxing and unboxing automatically. Then your JSON parser will deal with the primitive boolean instead.

You might also want to consider using mogenerator as that will add those boxing and unboxing methods and maintain your subclasses for you, automatically.

Sounds like the JSON Framework isn't recognizing that your number is of Boolean type. I would consider that a bug; I suggest you report it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!