Comments (6)
Added Warning in 0.0.9
from realmresultscontroller.
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.
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.
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.
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.
@jpaas That would be highly appreciated
from realmresultscontroller.
Related Issues (20)
- Remove TEST init HOT 1
- Filter info in README HOT 1
- Detecting changes introduced in an object saved through a relationship of another object HOT 3
- Defend against empty string in SortDescriptor?
- Create method to do manual changes notifications in Realm objects HOT 1
- .
- Swift 2.0 support? HOT 3
- Move RealmNotification inside RealmLogger
- Method to remove filter
- feature request: find indexPath of an object in the results
- Calling delegate methods in other queue delays rendering UITableView HOT 2
- attempt to delete and reload the same index path HOT 7
- When using addNotified() I am getting a 'Object must be from the Realm being queried' error HOT 2
- Cannot pass RealmRequest to RealmResultController HOT 5
- RealmResultsController causes SegFault #11 in Xcode 7.3.1 HOT 4
- Support for Realm 1.0? HOT 8
- Sections Not Updating Correctly HOT 2
- Library incompatible with Swift 3? HOT 1
- have you considered extending this to all RealmCollection types?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realmresultscontroller.