Swift + CoreData: Can not set a Bool on NSManagedObject subclass - Bug?

前端 未结 6 1339
谎友^
谎友^ 2020-12-16 13:02

I have a little strange issue which I can\'t seem to figure out, I have a simple entity with a custom NSManagedObject subclass:

@objc(EntityTest) class Entit         


        
6条回答
  •  遥遥无期
    2020-12-16 13:03

    I haven't touched swift, but in Objective-C, a BOOL is not an object, and cannot be an object. It's a primitive, and it looks like you are attempting to tell an Objective-C class to treat a BOOL like an object. But I could be making that up, as I'm not familiar with what @NSManaged does under the hood.

    https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/FoundationTypesandCollections/FoundationTypesandCollections.html

提交回复
热议问题