I just added a linked library to my project using the question here The process of linking ObjC static libraries to Xcode and the document related to the answer.
I know that the library uses CoreData objects, such as NSManagedObject, although in the xcode project of the library the CoreData structure is not added and created without errors. However, when I create my application, it has several errors, such as:
Undefined symbols:
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_AClass in library.a(AClass.o)
Thus, after seeing all the errors mentioned in the CoreData objects, I added the CoreData base platform to my application and successfully created it. So, now I tried to remove the CoreData environment from my application and added a library project, and they built both, and that failed.
So why does this work when coredata is added in my project, but not in the library project, and only the library uses it?
(and why is a library built without its own coredata framework?)
source
share