bigfish24 / abfrealmtableviewcontroller Goto Github PK
View Code? Open in Web Editor NEWUITableViewController With Data Binding To Realm Object Class
License: MIT License
UITableViewController With Data Binding To Realm Object Class
License: MIT License
How to do like this: [RLMSortDescriptor sortDescriptorWithProperty:@"dataDate" ascending:NO] ?
Thanks!!
RealmTableViewController has a property named "fetchedResultsController", which is a private instance of RBQFetchedResultsController. Normally this isn't problem... unless I want to highlight a cell, programmatically, based on an object which I know to be in the result-set.
Essentially, I want to say self.tableView.selectRowAtIndexPath(self.fetchedResultsController.indexPathForObject(objectInResults))
where objectInResults
is an object that I know to be a valid object that ends up getting displayed in this table.
Unfortunately, fetchedResultsController
is private, so I can't do this. I know that selectRowAtIndexPath only redraws the cell, and doesn't trigger anything else. But that's all I really need. I just want to force the selection, based on a single object.
Here's my setup:
I have a subclass of RealmTableViewController. I'm just trying to display info from a specific list of entities, lets call them "SpecialObjects"
So, I'm setting the entityName, basePredicate and sortDescriptors.
In my viewDidLoad routine, I'm making a web-service call to get all my "SpecialObjects". When my service successfully returns, I'm doing this:
try realm.write({ () -> Void in
realm.add(specialObjects, update: true)
})
My expectation is that my table-view will then update with the results from this call, since new objects are being added to my Realm database. But absolutely nothing happens.
What's weird, is that if I go "back" (which dismisses this view), and then re-enter the view, then the table gets updated as I'd expect. But the only reason that this works is because Realm already had my objects init, from the prior call. At least it's proving that the objects are actually in the database.
But the table isn't updated when new objects get added in after the view is up. No notifications are firing, even though I'm calling "realm.write". The big point of having this fetched-results-contoller is the ability to update the UI when the data changes. Why this isn't happening, I can't say. Any help in this would be greatly appreciated.
I used this library in my project and it works well on 64bit devices, but this bug happens on iPhone5 and iPhone4s. Basically I just copy codes from the demo project. Any idea what may cause this ? thanks in advance.
In updateFetchedResultsController, this line is bad:
self.fetchedResultsController.updateFetchRequest(fetchRequest, sectionNameKeyPath: nil, andPeformFetch: true)
It's sending "nil" for sectionNameKeyPath, when we have a "sectionNameKeyPath" property. I created a PR for this here: #3
I'm new to Realm, but setup was relatively easy and dropping in RealmTableViewController was very straightforward. But when I add multiple instances, I run in to an issue. I'm embedding three tableview controllers inside a UIPageViewController, so the user can swipe between a couple of lists. As soon as the second list comes on screen (i.e., is instantiated and starts updating), the app locks up. It appears that the multiple instances of RBQFetchedResultsController get deadlocked down in the innards somewhere. I've inquired about the deadlock in an open issue on that project, but I thought I'd mention it here to see if there are any pointers.
I see there's an open issue to refactor out RBQFRC (#8). Is that related?
It`s possible to replace the UITableViewController for TableView? It will make this library more flexible to use with custom views.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.