xcode,  swift,  ios

Creating NSManagedObject subclasses from a model in Xcode 8

In Xcode 8, it is no longer possible to create NSManagedObject subclasses...

Creating NSManagedObject subclasses from a model in Xcode 8

The problem:

In Xcode 8, it is no longer possible to create NSManagedObject subclasses by going to File menu and choosing New > File and then selecting NSManagedObject subclass from the iOS > Core Data section. That option simply does not exist.

The solution:

Select the model in the Project Navigator on the left and go to Editor menu and choose Create NSManagedObject Subclasses from there.

A sidenote:

If the project was upgraded to Swift3 there is a good chance that the wizard will generate Objective C files instead of Swift files.

To fix that go to the selected model’s File Inspector and change Code Generation language to swift.

Subscribe to The infinite monkey theorem

Get the latest posts delivered right to your inbox