I just discovered the Fetch Requests section of the Core Data graphical editor and it looks like it could be a great asset in keeping my project organized.
I have two problems though:
1 - I can't find the documentation on how to use it anywhere. All of the documentation I can find from google searches combining the various terms "Core Data", "Graphical", and "Fetch Requests" just turn up documentation on either how to use the entities, attributes, and relationships section of the graphical editor, or how to programmatically write fetch requests.
2 - How do I use the fetch request that I put together in my Core Data model inside of my code? I'd like to assign this fetch request to an NSFetchedResultsController.
And on an only partially related note, what is the "Configurations" section of the Core Data model editor? Does anyone have examples on how to use it or how it's useful? (I just figure while I'm learning more about the Core Data editor I may as well ask about all the parts of it I don't understand / I've never used before.)
Edit:
Okay, I'm not sure if this is the best way of doing it, but I've found that NSManagedObjectModel has a method fetchRequestTemplateForName: which seems to accomplish #2. Note that the method seems to return an immutable NSFetchRequest of sorts, so you have to make a copy of it first.
I have two problems though:
1 - I can't find the documentation on how to use it anywhere. All of the documentation I can find from google searches combining the various terms "Core Data", "Graphical", and "Fetch Requests" just turn up documentation on either how to use the entities, attributes, and relationships section of the graphical editor, or how to programmatically write fetch requests.
2 - How do I use the fetch request that I put together in my Core Data model inside of my code? I'd like to assign this fetch request to an NSFetchedResultsController.
And on an only partially related note, what is the "Configurations" section of the Core Data model editor? Does anyone have examples on how to use it or how it's useful? (I just figure while I'm learning more about the Core Data editor I may as well ask about all the parts of it I don't understand / I've never used before.)
Edit:
Okay, I'm not sure if this is the best way of doing it, but I've found that NSManagedObjectModel has a method fetchRequestTemplateForName: which seems to accomplish #2. Note that the method seems to return an immutable NSFetchRequest of sorts, so you have to make a copy of it first.
Last edited: