I'm building an app for a blog where a user can save their favorite posts.
When they do, I want to store my object which contains: the post's URL, title and image URL.
Should I go for UserDefaults
(formerly NSUserDefaults
) or start with Core Data
right away?
Since favorites for articles generally wont be 100K item then I would use
NSDictionary
for an item and store them into aNSMutableArray
and then save them to a file. It is simple to use and you can also export the favorites to a file or eveniCloud
to share between devices.There are more possibilities here: you can also use plain files or plists, or use sqlite without Core Data. The answer depends on the number of items that you plan to store: