wm.p1us
wm.p1us

Reputation: 2059

Core Data Xcode 8

I started new project without core data checked and then I tried to put it in manually. So everything is fine but I have a question concerning Codegen in Data Model Inspector.

When I put class definition in Codegen field my class was redefined in appropriate to core data way so I deleted my old one. And after I saw extension of this new class where I could find all the properties.

So after I closed I couldn't find it in my project but I want to see it again. How can I make it appear again?

Upvotes: 1

Views: 544

Answers (1)

Chris Hanson
Chris Hanson

Reputation: 55086

When an NSManagedObjectModel is configured to generate code, it doesn't add that code to your project. Rather, it generates that code into your Derived Data, in the DerivedSources directory for the target the model is a part of.

In Objective-C, you can just use #import "ModelName+ManagedObjectModel.h" in your other code to gain access any of the entities for which code has been generated. In Swift, you don't even need to do that, you can just use the classes that were generated.

If you want to see the code for those classes, you can use Open Quickly (command-shift-O) and type in one of the class names. Xcode should take you right to the generated source code for it.

Upvotes: 1

Related Questions