I have a UITableView which displays two different entity types -- each row could be either EntityA or EntityB. cellForRowAtIndexPath looks at the class type and determines how to create the cell.
I am persisting my objects using Core Data and would like to use a fetchedResultsController to manage this tableview because of the memory-management benefits. However, I cannot figure out a way to create a fetchedResultsController that can fetch more than one type of entity. Because the fetchedResultsController initializer takes an NSFetchRequest, and the latter only allows a single entity to be identified, I don't think what I want to do is possible.
Assuming it is not, what alternatives do I have? Could I do something like single table inheritance, creating an entity model that merges the features of my two entities (they are similar)? This would add complexity to my code and weaken the typing significantly but the user would never know the difference.
All suggestions welcome.
Thanks!
/afb