GithubHelp home page GithubHelp logo

Comments (6)

polqf avatar polqf commented on September 25, 2024

Added Warning in 0.0.9

from realmresultscontroller.

isaacroldan avatar isaacroldan commented on September 25, 2024

Not sure, we can't make the public var sections return all the mapped objects. It will be necessary to remap everything each time it is called, that could affect the performance of the RRC. I would leave it like this for the moment, the RRC works perfectly without this, will refactor in the future to maybe separate in two functions: one to return section info (keypath, without the objects), another one to return all the objects in a section

from realmresultscontroller.

jpaas avatar jpaas commented on September 25, 2024

This may not be the right place to ask, but it seems related. I need to find the indexPath of an object in my rrc in order to select it. I thought that the objects property of RealmSection might be the way to do it, but ain't no objects. Is there any way of getting all of the objects to enumerate them? Or alternatively a way of finding the indexPath for an object?

from realmresultscontroller.

polqf avatar polqf commented on September 25, 2024

Hi @jpaas ,
At the moment we don't have any method to easily do it.

The only thing that comes to my mind with the current configuration is to do something like this:

        let section = //SECTION YOU ARE INTERESTED IN
        for i in 0..<realmResultsController.numberOfObjectsAt(section) {
            let indexPath = NSIndexPath(forRow: i, inSection: section)
            let object = realmResultsController.objectAt(indexPath)
            if /*Check if is the desired object*/ {
                return object
            }
        }

If you have a better idea, feel free to open a PR 😄

from realmresultscontroller.

jpaas avatar jpaas commented on September 25, 2024

Thanks @poolqf that looks like it will do the trick. And thanks for the quick reply! I may very well open a PR. Perhaps a method that takes some sort of block to match criteria would be nice.

from realmresultscontroller.

polqf avatar polqf commented on September 25, 2024

@jpaas That would be highly appreciated 🤗!

from realmresultscontroller.

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.