Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Support of transient property for sectionName #69

Closed
zarv1k opened this issue May 14, 2016 · 9 comments · Fixed by #70
Closed

Support of transient property for sectionName #69

zarv1k opened this issue May 14, 2016 · 9 comments · Fixed by #70
Assignees

Comments

@zarv1k
Copy link
Contributor

zarv1k commented May 14, 2016

Transient property for sectionName does not supported for now.
When I use 'firstLetter' (transient property) as sectionName in DATASource initializer I got error:
'Invalid keypath firstLetter passed to setPropertiesToFetch:'
There is an issue in default implementation of UIDataSourceTableView.sectionIndexTitlesForTableView:. I suppose this method should detect is property transient and should not execute request when property is transient. Or maybe this metnod should notify developer somehow that when using transient property he must implement DATASourceDelegate.sectionIndexTitlesForDataSource: in this case.

@3lvis
Copy link
Owner

3lvis commented May 16, 2016

Hi @zarv1k,

Is this even possible with vanilla NSFetchedResultsController? I can't remember been able to make this work before. Would you mind sharing a sample code to try it out and make sure it also works here?

@zarv1k
Copy link
Contributor Author

zarv1k commented May 16, 2016

@3lvis ok, when I have time (probably at evening today) I'll try to modify your TableSwift example for using 'firstLetterOfName' as transient property instead of managed.

@3lvis
Copy link
Owner

3lvis commented May 16, 2016

Thanks a lot!

@Sorix
Copy link

Sorix commented Aug 21, 2016

Transient property sorting is very important by my mind, for example if you want to group items by month without storing month in database (only NSDate usually stored).

If Core Data has issues with «COUNT» maybe it will be better to specify var in DATASource configuration (e.g.: var supportTransient: Bool) where we can enable transient support by specifying that after DATASource initialization?

NSFetchedResultsController supports sectioning by transient properties out of the box without any magic, it is very strange if DATASource won’t have support of that.

@3lvis
Copy link
Owner

3lvis commented Aug 21, 2016

@Sorix that could be an option.

@rottajuliano
Copy link

I agree with Sorix, I really needed to sort in daily sections, got stuck while trying to make DATASource support it and now will switch back to NSFetchedResultsController for a while :/

@henkvanderspek
Copy link

henkvanderspek commented Oct 28, 2016

The funny thing is, it worked in v. 6.0.0 for sure and it crashes in v. 6.1.1

@henkvanderspek
Copy link

Cool! Thanks

@3lvis
Copy link
Owner

3lvis commented Jul 19, 2017

Doing some spring cleaning, please make a new issue if you still want to do this.

@3lvis 3lvis closed this as completed Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants