1
votes

from documentation (What's New In Core Data)

Xcode automatic subclass generation Xcode now supports automatic generation of NSManagedObject subclasses in the modeling tool. In the entity inspector: Manual/None is the default, and previous behavior; in this case you should implement your own subclass or use NSManagedObject. Category/Extension generates a class extension in a file named like ClassName+CoreDataGeneratedProperties. You need to declare/implement the main class (if in Obj-C, via a header the extension can import named ClassName.h). - Class Definition generates subclass files named like ClassName+CoreDataClass as well as the files generated for Category/Extension. The generated files are placed in DerivedData and rebuilt on the first build after the model is saved. They are also indexed by Xcode, so command-clicking on references and fast-opening by filename works.

Codegen can be seen here and no matter what i chose it doesn't get generated.

i'm probably doing something wrong or incomplete, aren't i?

1

1 Answers

3
votes

If you set "Codegen" to "Class Definition", like in your example, Xcode does generate the NSManagedObject subclasses, but you do not actually see the in your project. Like stated in your posted quote, the files are generated in

~/Library/Developer/Xcode/DerivedData/...

You do not see them in your project, only the files in Derived Data, which you should not have to care about. Xcode does hold a reference though, so command+clicking in code jumps to the implementation as expected plus you are able to write extensions and such.

Find details in this answer.