Reputation: 24737
I configured the following core data class:
class Project: NSManagedObject {
@NSManaged var lastUpdateTime: NSDate
@NSManaged var name: String
@NSManaged var prevProejct: Project
}
A project in this data model can have a previous project. I configured the relationship to be 'optional'. However, the field in the class is not configured as optional - i can't set nil to prevProject.
so how can i set the relationship to nil?
Upvotes: 0
Views: 435
Reputation: 14030
I have two thoughts on this:
@NSManaged var prevProejct: Project?
or:
prevProejct = NSNull()
Upvotes: 1