-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate fetched results controllers for to-many relationships #88
Generate fetched results controllers for to-many relationships #88
Conversation
This are generated when `frc=true` is used as a template variable. The cache name is generated from a combination of the entity name, indexed attributes, relationship name and sort descriptors to try to make it unique. If there are no indexed attributes, the cache name is nil because using different fetch requests with the same cache name completely borks the fetched results controller.
Is there a way within the template to count the number of attributes that are indexed? This will allow the template to know whether it can generate a cache name or not rather than putting that logic in the generated code. |
Thanks man
I don't think that's possible within the template, but would be easy to add a category in mogenerator.m that the template could read. Let me know if you want to tackle the category or if you just want me to pull this right now. |
I'll take a look into the category. :) |
If everyone can look past my stupidity for a second there, this now produces nice clean output. :) |
…lerMethods [NEW] Generate fetched results controllers for to-many relationships. (Daniel Tull)
That's exactly what I was looking for, thanks! Pulled. |
…sControllerMethods [NEW] Generate fetched results controllers for to-many relationships. (Daniel Tull)
This are generated when
frc=true
is used as a template variable.The cache name is generated from a combination of the entity name, indexed attributes, relationship name and sort descriptors to try to make it unique.
If there are no indexed attributes, the cache name is nil because using different fetch requests with the same cache name completely borks the fetched results controller.