O
O
Oleg Tsvetkov2016-04-24 15:32:41
Swift
Oleg Tsvetkov, 2016-04-24 15:32:41

How to make a tape of records on CoreData?

I want to make a news feed based on UITableViewController (with pull-to-refresh and endless-scroll) - HistoryTableViewController, the data is pulled from the server and stored in CoreData.
How best to organize the work of the tape:

  1. Pulling data into an array, and then displaying it - in many articles it is advised to do this, but I am confused by a huge array of objects in memory ...
  2. controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: - I tried to use it, but I have lines of different heights and it was a lot of fun when the continuation of the tape was loaded.
  3. The HistoryTableViewController conforms to the NSFetchedResultsControllerDelegate protocol, but does not contain an implementation of any of the protocol's methods. Data is fetched using NSFetchedResultsController and tableView.reloadData() is called. (now so)
  4. Something other?

I don't want to get acquainted with Magical Record and similar things yet.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2016-04-24
@olegtsvetkov

what "huge array of objects in memory"?
pull up as many records as you can show on the screen (or a little more).
the rest are pulled up either on demand or on scroll.

T
Tyoma Semavin, 2016-05-27
@SemavinA

Maybe use NSFetchedResultsController?

NSFetchedResultsController provides the interface between Core Data and UITableView objects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question