I have found a few questions regarding this issue, yet none of them were helping with my problem. I am trying to save an object to core data using this code (which worked perfec
What helped me in similar problem (xCode 7, Swift 2):
reading this question
Or more quickly without explaining the reason of solution: just comment @objc(className)
in your NSManagedObjectSubclass
, that was generated from your CoreData Entity (@objc(Patient)
- in your case ).
This solution (if issue still appears) does not applicable to xCode 7.1/Swift 2.1, as the way of generating NSManagedObjectSubclasses
was changed.
Don't forget about cleaning your project (Product > Clean
) and deleting the app from your device/simulator to replace CoreData storage on it.