user2903517
user2903517

Reputation: 77

Use NSArrays/NSMutableArrays and save in coreData or CorData only?

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:

  1. Continue using the NSMutableArray and use the CoreData to load and save items.
  2. Forget the NSArray and work only with CoreData

What'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

Answers (1)

Mundi
Mundi

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

Related Questions