Ilya  Lyaschenko
Ilya Lyaschenko

Reputation: 41

About usage framework coreData

What is the best way to use CoreData:

1 - The first time I load all items from the store in the array, in the future, when I have to get one item (or more,meet certain properties), I just do filtering array (filteredArrayUsingPredicate)

OR

2 - Every time when I need to get the items (one item or several or all items) I load those games all from the repository?

When I am asking what is the best way, I actually mean what is the most efficient and most common way (quickest response time)?

Upvotes: 1

Views: 73

Answers (2)

Mundi
Mundi

Reputation: 80265

Don't use data arrays, and don't use 3rd party libraries.

Rather, read up on NSFetchedResultsController and discover how simple and scalable core data can be.

Upvotes: 1

Leszek Zarna
Leszek Zarna

Reputation: 3317

Use MagicalRecord library. It has convienience methods like: MR_findAll MR_findFirst MR_findFirstByAttribute and many, many others.

Upvotes: 1

Related Questions