Question

The app that I am working on allows users to favorite podcast channels. I have been told that the best way to keep track of this is through core data. My initial thought was that it was the best way, but after giving it more thought, it seems overkill for this one feature. The way I understand Core Data is that it is Apple's recommended way of implementing the app's model layer, but we are not using it. What would you recommend to accomplish this feature? Also, we are not storing all of our data locally. The only data we are storing is the mp3 files that the user downloads, which are saved into the documents directory.

Was it helpful?

Solution

If you are persisting data (such as podcast urls, episode information, etc.) then you should store all of it in one place. Core Data can do that easily.

How much data are you storing? I would guess from your app description that you have more data than just what is a favorite.

Update

If you are storing a favorite flag you need something to associate it with. A URL perhaps.

If you are storing the URL, you might as well cache the podcast name with it.

If you are storing the name, might as well cache the episodes.

See where I am going? :)

Keep a local cache of what you are getting from the web and the user gets a better experience because they see data on launch, they don't need to wait for the internet which is random.

If you are caching data, then yes! use Core Data. Otherwise, NSUserDefaults is probably sufficient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top