Search code examples
objective-ccore-datansmanagedobjectxcode9-beta

Core Data NSManagedObject in Xcode 9 beta


NSManagedObject Subclass is absent form Xcode 9 project files templates. Data Model and Mapping model project file templates are present. What we should be using instead of NSManagedObject Subclass while doing objective c programming using core data?

enter image description here

That project template of NSManagedObject is absent


Solution

  • You should still use NSManagedObject subclasses.

    The option you're looking for moved to the "Editor" menu (last year, I think-- it's not new). It's now called "Create NSManagedObject Subclass".

    This is where you find it:

    enter image description here

    However, Since Xcode 8, class generation is automatic if you want it to be. Each entity now has a "Codegen" setting in the model editor that controls how this works. You can choose a couple of different automatic generation options, or you can turn off automatic code generation.