Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sounds like the old model/view confusion. reloadData will merely re-display the data that is already in the data source, not load in new data. You can call </p> <pre><code>[yourFetchedResultsController performFetch:&amp;*error]; </code></pre> <p>everytime new data is available, to force an immediate update. As you saw, the NSFetchedResultsController will update its results, but when and how often is dependant on whether it has a delegate and whether the cache file name is set. I quote from NSFetchedResultsController Class Reference:</p> <blockquote> <p>In addition, NSFetchedResultsController provides the following features:</p> <p>It optionally monitors changes to objects in its associated managed object context, and reports changes in the results set to its delegate (see “The Controller’s Delegate”). It optionally caches the results of its computation so that if the same data is subsequently re-displayed, the work does not have to be repeated (see “The Cache”).</p> <p>A controller thus effectively has three modes of operation, determined by whether it has a delegate and whether the cache file name is set.</p> <ol> <li><p>No tracking: the delegate is set to nil. The controller simply provides access to the data as it was when the fetch was executed.</p></li> <li><p>Memory-only tracking: the delegate is non-nil and the file cache name is set to nil. The controller monitors objects in its result set and updates section and ordering information in response to relevant changes.</p></li> <li><p>Full persistent tracking: the delegate and the file cache name are non-nil. The controller monitors objects in its result set and updates section and ordering information in response to relevant changes. The controller maintains a persistent cache of the results of its computation.</p></li> </ol> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload