-
Notifications
You must be signed in to change notification settings - Fork 25
When asking for the RRC sections, getting RealmSections without objects #14
Comments
Added Warning in 0.0.9 |
Not sure, we can't make the |
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? |
Hi @jpaas , 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 😄 |
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. |
@jpaas That would be highly appreciated 🤗! |
Now, when asking for the RRC sections we are getting a RealmSection object with just its sectionKeyPath
line 173
The text was updated successfully, but these errors were encountered: