I am trying to save a custom class into core data but it is giving me this error on @NSManaged public var deck: [card]?
in the generated NSManagedSubClass. Could anyone point me in the right direction?
extension Deck {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Deck> {
return NSFetchRequest<Deck>(entityName: "Deck")
}
@NSManaged public var deck: [card]?
@NSManaged public var name: String?
}
@NSManaged public var deck: [card]?
The card
of this line of code is a custom class, you cannot use it as a datatype in your NSManagedObject.
The solution is making Card a subclass of NSObject:
class Card: NSObject {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With