CoreData: warning: Unable to load class named

Solution 1:

This warning is one of the quirks we have to deal with while the details of the Swift implementation are being ironed out. The warning occurs spuriously, i.e. your setup might work even if you do not follow the steps outlined below.

I have been able to get rid of it in most cases by making sure that the class is set correctly in the model editor. Unlike in many other SOF posts (including answers to this question), the suggestion to include the module name (like MyApp.Shows) has not helped me.

Make sure you check these three items:

1.
Version that works up to Xcode 7 beta 3

Up to XCode7 b3

Notice that I corrected your entity name to the more appropriate singular.

Version that works for Swift 2.0 in Xcode 7.1
(Should work for Xcode 7 beta 4 and above)

You need to delete the text "Current Product Module" in Module!

From Xcode7 beta 3

2.
You should also follow the frequent recommendation to include

@objc(Show)

just above your class.

Note: If you are using Xcode 7 beta 4 or later, this step is optional.

3.
Also make sure to cast the created managed object to the proper class, as the default would be just NSManagedObject.

var newShow = NSEntityDescription.insertNewObjectForEntityForName("Show", 
                 inManagedObjectContext: context) as Show

Solution 2:

SWIFT 2 / XCODE 7 Update:

This issue (see my April 3 comment on this answer as well) is resolved in Swift 2 and XCode 7 beta release by Apple. So you actually now do not need @objc(myEntity) in Swift as answered by Mundi or using "MyAppName." before your Class name. It will stop working. So remove these, just put Class name in File and select Current Working Module as Module and cheers!

Selecting current working module

But for those using @objc(myEntity) in Swift (like me), you can use this other solution instead which works smoothly.

In the xcdatamodel correct class in. It should look like this:

Setting the class

Here you go. Module.Class is the pattern for CoreData in Swift and XCode 6. You will also need the same procedure when using Custom Policy class in Model Policy or other CoreData stuff. A note: In image, The Name and Class should be Car and MyAppName.Car (or whatever the name of your entity). Here, User is a typo.

Solution 3:

When using Xcode 7 and purely Swift, I actually had to remove @objc(MyClass) from my auto-generated NSManagedObject subclass (generated from Editor > Create NSManagedObject Subclass...).

Solution 4:

In Xcode 7 beta 2 (and I believe 1), in the model configuration a new managed object of type File is set to the Module Current Product Module and the class of the object is shown in configuration as .File.

Module of managed object type set to "Current Product Module" in Xcode 7

Deleting the module setting so it is blank, or removing the full stop so the class name in configuration is just File are equivalent actions, as each causes the other change. Saving this configuration will remove the error described.

Module of managed object set to be blank in Xcode 7