Reputation: 72
If I have a large amount of information that will be randomly used while the app is being used, what is the best way to store and access that data?
The app completely relies on the static text that I have and will need to grab certain parts and concatenate them depending on what the user selects within the app.
Is it best to load it into Core Data when the app loads the first time and then check if it is loaded every time after that? If so, how?
Upvotes: 0
Views: 536
Reputation: 40502
Core Data is completely inappropriate for your use case.
Store your text in a .strings
file and use NSLocalizedString()
to access it. This will provide a convenient way to lookup text by key and make localization simple.
Upvotes: 0
Reputation: 64428
Core Data's primary focus is not persisting data but instead on managing a complex graph of objects that contain and manipulate data. The API is intended to create the entire model layer of a Model-View-Design application.
If you have a lot of chunks of text all that need separate logic or if your app will create those chunks out of a large body of text, then core data is a good choice.
If you just have something like a very basic text editor then probably not.
Upvotes: 1