Roobiq / RBQFetchedResultsController

Drop-in replacement for NSFetchedResultsController backed by Realm.
MIT License
477 stars 70 forks source link

SectionNameKeyPath cannot be transient? #123

Open inPhilly opened 7 years ago

inPhilly commented 7 years ago

I believe this is supposed to be a drop-in replacement for NSFetchedResultsController. NSFetchedResultsController allows a transient (non-persisted) property for sectionNameKeyPath. This is a very important aspect of NSFetchedResultsController. There are many times where sectionNameKeyPath is better not to be a persistedProperty. For example, we may sort the data by NSDate. Say there are 10 objects and each has a different date but is within the same month. SectionNameKeyPath would be a way that we could keep the sort order (date) yet not group the items by date, but by a broader grouping such as month or year. This is just one example; I have 10s of cases in my app where sectionNameKeyPath needs to be a transient (non-persisted) property. I simply cannot create an additional field each time I need a non-persisted sectionNameKeyPath. Since this is a drop-in for NSFetchedResultsController, which does offer that functionality, is this something that could possibly change for RBQFetchedResultsController? Is it on the roadmap at all, if this is still being updated?

malhal commented 4 years ago

NSFetchedResultsController may work with a transient property as sectionNameKeyPath but you will soon discover why you shouldn’t. Every object in the fetch result gets faulted just to find out its section!