简体   繁体   中英

How to add core data classes to a framework in iOS

I am trying to create a framework out of my existing codebase for the purpose of reuse. I have a exmaple.xcdatamodeld class which in turn contains some core data classes. I have added this entire exmaple.xcdatamodeld class into my new framework. But i am getting an error which says that some of the classes in my exmaple.xcdatamodeld are missing. (Example: classname.h file not found ). Am i doing something wrong while adding the entire core data class? Can anyone help me out with my problem...

I have taken this link as a reference while creating the framework

edit : I am not getting the option of adding all the core data classes individually. It seems i can add only the complete datamodel file. PLease refer the screenshot below. 在此处输入图片说明

exmaple.xcdatamodeld is your data model. If it refers to any classes that you've created (which will be subclasses of NSManagedObject), you'll need to include the source files (.h/.m files) for those classes in your framework.

The .xcdatamodeld file is just the model, a serialized version of the NSManagedObjectModel . It does not contain any classes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM