I have an abstract Entity A, I also have two Entities whom's parent is Entity A. Each child has different relationships to other Entities.
I am trying to fetch all child Entities of Entity A, who's isPublic boolean value is YES.
I've had trouble with fetching subclassed Entities in the past in relation to fetching, and I'm sure I'm just not doing it correctly.
So we could say for example that : • Entity A is "Document", • Entity B is "Poem", • Entity C is "Article"
All poems and articles subclass document, and document has a property called isBookmarked, the suer can bookmark a poem or article, and I need a way of fetching all documents that are bookmarked. Entities B and C need to be independent because of other relationships that they own.
I want to use NSFetchedResultsController for optimal Core Data and UITableView performance, and I'm struggling to fetch a mix of poems and articles.
What fetch request would give me a mix of poems and articles ?
The answer of Wienke should work, if you just add
[request setIncludesSubentities:YES];
otherwise you will only receive results of the A entity, which should be non as you said it is abstract.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With