Reputation: 77
I'm learing CoreData. I have a simple program that loads a file to a NSMutableArray
, insert items in an NSMutableArray
, shows data, and when we close the app saves to file.
I want to change my app to use coreData.
I think there are two way to do this:
NSMutableArray
and use the CoreData to load and save items.NSArray
and work only with CoreDataWhat's the best way? Only coreData or use NSArrays
and then save to CoreData? What's the best practice for this app in particular and future apps?
Thank you for your help.
Upvotes: 0
Views: 315
Reputation: 80271
You could use Core Data only to persist your data to disk. However, you would be giving up a lot of convenience that comes with e.g. the NSFetchedResultsController
.
Especially when you have lots of data, the full array of your objects in memory might soon be too much for a device to handle. Core Data includes a great set of tested and mature technologies that help you to keep the integrity of the object graph, manage memory and performance with minimal effort from your part.
Upvotes: 1