Im am trying to improve a ToDo app for the iPhone.
I have two entities, 1. Task 2. Project
A project can have multiple tasks but a task may have none or one project.
I have been trying to display both in the same UITableView using NSFetchedResultsController
is it possible to fetch two entities and display/sort them both from the same UITableView?
Not sure I understood completely, but you’re trying to display Projects and Tasks in the same UITableView?
Off the top of my head I’d say you want to make an abstract entity, “Displayable” or something like that, and make it the parent of your Task and Project entities. (Assuming they display the same in your TableView). Then get all those and you’ll have your full result set.
Note that I haven’t tried this myself, but in theory it should do what you want.
Alternately, if that isn’t an option, you could use two NSFetchedResultsControllers, one for each Entity, and just add some fancy conditional code to your rowForIndexPath: (or whatever) methods. Sorting might be a problem, though.