-1

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

1 Answers1

3

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.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • I have seen "Editor" in Xcode 9 .There is no option for "Create NSManagedObject Subclass".as you check this link https://www.google.com.pk/search?q=editor+menu+xcode+9&num=100&newwindow=1&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiOv5_F4YbVAhXoIcAKHbLGC00Q_AUICigB&biw=1024&bih=601#imgrc=qoFDxIE_Ba9s1M: –  Jul 13 '17 at 17:19
  • That link is meaningless. The items on the "Editor" menu change depending on what you're doing in Xcode. If you are editing a Core Data model, this option is available. Otherwise the menu contains other items appropriate to your current activity. – Tom Harrington Jul 13 '17 at 17:22
  • i have uploaded images." Create NSManagedObject Subclass" is absent –  Jul 14 '17 at 01:18
  • You didn't read my comment. The items on the menu change depending on what kind of document you are editing. The Core Data option is only present **when you are editing a Core Data model**. You screenshot shows that you are not doing that, therefore the option is not present. I'm honestly sorry that I tried to help you at this point. – Tom Harrington Jul 14 '17 at 03:02