Reputation: 5096
I want to build an app that I can fetch notifications from server and save notification inside client devices for limitation only(50 Messages).But,I want to know that I need to use CoreData
to store the data fetch from Server inside client app or not?If it is not,what should I use?I really need a hand to pick me up.Thanks.
Note: I only want to store 50 Notifications only inside UITableView
Any help?Please
Upvotes: 2
Views: 585
Reputation: 1577
The intended use of core data is to store complex entities and large set of data with relationships. But since your data set is simple and small, it will be a better approach to use Plist
files to store notification json.
Plist downside over NSUserDefaults: The downside of Plist
files over NSUserDefaults
is you have to write some extra code for file management (Copy/Read/Write).
Plist upside over NSUserDefaults: It separates your data from NSUserDefaults
.plist file, which holds some other application related data.
If you don't want to code more then simply go with NSUserDefaults
.
Upvotes: 1
Reputation: 1693
I think you should use Coredata, it 's simple & easy if your list notification have count > 50 , you can delete the first object and add new notification into last of list when you open application, you can fetch Notification from coredata & sort with time,you can detech it was viewing or not with a variable is_view in notificationModel of coredata...
Upvotes: 1