I have an app which uses core data and i'm trying to add a today extension to it which also access the data I have it set up so far and its able to access the data, but i'm having trouble with the classes for the entities. I get the following error
CoreData: warning: Unable to load class named 'Med_Track_2.Medicine' for entity 'Medicine'
Med_Track_2
is the product name for the main app, Medicine_Tracker_2
is the name for the extension
The medicine class is added to both targets
Is there a way around this?
Share Extension is an easy way that Apple provides to share contents (images, audio, files, etc.) from one app to another, even made by different developers.
The persistent store should be located in the AppData > Library > Application Support directory.
Core Data is an object graph and persistence framework provided by Apple in the macOS and iOS operating systems. It was introduced in Mac OS X 10.4 Tiger and iOS with iPhone SDK 3.0. It allows data organized by the relational entity–attribute model to be serialized into XML, binary, or SQLite stores.
You have to share the resources between your app and your extension. Read the "Sharing Data with Your Containing App" chapter: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1
Also you have to add the files you want to use to the Extension's target too. (Edit the Build phases / Compile Sources sections of the extension's target)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With