ios - Unable to find specific subclass of NSManagedObject -


I am working on developing an app with core data. When I made an example by using them:

  entity = NSEntityDescriptionkentityForName ( "user", Mennirmit object Contaks: appDelegate.managedObjectContext) User User (unit: body, insert Krenmaniejendtonsteks: appDelegate. managedObjectContext) / Code>  

received a warning for me logged:

  Kordeta: Warning: the unit is unable to load the name of 'user' 'category' class Not found, instead of the default NSManagedObject sub By doing yoga  

How can I fix this?

And another question, how can I define an example method in the NSManagedObject subclass?

Edit:

I have specified the unit square in the following screenshot:

update for Preepeding:

class module name (Akskod 6 and the first beta release of Akskod 7) is no longer required. Apple documentation has been updated accordingly.

the data model is now a unit inspector L The new "class" and "modules" two fields:

When you create a Swift managed object sub-unit, "modules" field set to "current product modules" , And this setting works in both the main application and the unit test. Object sub-class not to @objc (classname) (This was seen).

Alternatively, You can access the "Module" form Ld can clear (it marked the managed object subclasses with "no show no") and @objc (classname) (that was observed in this).


Note: This answer was originally written for Xcode 6. Various Xodod 7 Beta releases made some changes regarding this problem. Since it is an approved answer with many upvots and its links, I have tried to summarize the situation for the existing Xodod 7 Ultimate Edition.

I did my own "research" and all the replies both of this question and the same question attributed to them all, even though I did not specifically list them!


Xcode 6 in the previous response:

As for documents, you Institutions class field model unit inspector by the name of your module The class name must be prefixed, for example "MyFirstSwiftApp.User".


Comments