Storing app data under one entity Core Data


Storing app data under one entity Core Data



I am making an app where a string is shown, and then they have to pick the correct string from 4 options.



I need to update a score, based on whether they get it right or wrong.



Let's call the string that is shown to them:


shownString



For ease and efficiency, I am planning to have ONE core data entity and only store one object for that entity, which will be a transformable type, that is an array with nested arrays/tuples, that contains shownString and the score for every shown string that could come up in multiple choice.



The reason I am doing it like this as opposed to storing individual objects for each word and score is because it will make it easier to update the object i.e. delete and add it back in again.



I am fairly new to Core Data, so please could you tell me if there are any problems with this, or if you think it is a good/acceptable way that will work well then please also tell me.



Thanks





What's the point of using core data if you're only going to have one instance of a string in it? You're not taking advantage of what core data can offer and the code you'll write to handle the data in your string will most likely be complicated and error prone.
– Joakim Danielson
Jul 1 at 19:50









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API