Core Data Boolean property NSNumber doesn't remember it's boolean

后端 未结 3 1040
暗喜
暗喜 2021-01-12 12:57

I have a model with a property that looks like this:

\"enter

When I set its va

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 13:37

    Its stored as a NSNumber - by the way @YES is creating a NSNumber like

    [NSNumber numberWithBool:YES]

    so to get the bool back out you do:

    [isResolved boolValue]

    (you can avoid this by ticking the Use Scalar Properties when you create your models)

提交回复
热议问题