Giter Site home page Giter Site logo

Comments (2)

bigfish24 avatar bigfish24 commented on June 17, 2024

(Reposting from the realm-cocoa thread...):

I would suggest you look at the implementation for ABFRealmGridController because this is a UICollectionViewController subclass that is using RBQFRC as its backing data source. It automatically updates based on results from the New York Times API and animates the changes... I have never encountered the scenario you describe.

from rbqfetchedresultscontroller.

bigfish24 avatar bigfish24 commented on June 17, 2024

The issue was related to how Realm notifies other Realm instances to update. When you commit a write transaction on a background thread, a notification is then sent to other Realm instances on other threads (this works through a named pipe) to refresh to the latest version of the DB that includes the recently committed transaction. The problem though is that notification is processed on the receiving thread only during the default run loop mode. When you are scrolling, the main thread will run in NSEventTrackingRunLoopMode for that pass of the run loop. This means that Realm's notification will not be processed until the thread is back in default mode.

The result of this means that RBQFetchedResultsController should simply manually call refresh on the Realm that contains the objects backed by the FRC before attempting to retrieve it. This alleviates the assumption that the notification to trigger the refresh has been processed before object/safeObjectAtIndexPath: is called.

I can confirm this commit fixes the problem: 03de5b6

from rbqfetchedresultscontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.