0

I have a NSManagedObject subclass that I generated using the editor menu >> Create NSManagedObject Subclass...

It inherits everything and it looks like this: import Foundation import CoreData

class Person: NSManagedObject {
    @NSManaged var firstname: String
    @NSManaged var lastname: String
}

But, when I try to create an instance from my Person class I don't get code hinting entity: entityDescripition, insertIntoManagedObjectContext: managedObjectContext for the designated initializer, when I ignore it and use it anyway this is what I get:

CoreData: warning: Unable to load class named 'Person' for entity 'Person'. Class not found, using default NSManagedObject instead.

But I have the Person class in my project, it is in my compile source in my build phases, the same thing in Objective C works immediately though..

Any thoughts?

Guillaume Algis
  • 10,000
  • 5
  • 39
  • 68
  • @MichalCiuba agreed but adding my project name prefix to the entity class doesn't fix it for me, updated it to Foo.Person, also adding the @objc(Person) doesn't give me the proper code hinting or gets rid of the error... – thomasdegry Nov 20 '14 at 18:08
  • @thomasdegry: consider documenting what you've done to fix the issue, and link to questions with failed solutions. – sam-w Nov 21 '14 at 05:43

0 Answers0