I have no experience with CoreDate, but may be NSFetchedResultsController
class will be suitable for your task.
If you don't want to show your different entities in separate table sections I think the easiest way to mix them will be to use single array to store and handle your data.
To make things easier you can declare a protocol with methods common for your entities (e.g. date attribute) and make your entities conform it:
@protocol MyEntityProtocol
- (NSDate*) date;
@end
Sorting: You can sort your array for example using sortedArrayUsingFunction:context:
function.
NSInteger entityDateSort(id<MyEntityProtocol> obj1, id<MyEntityProtocol> obj2, void *context){
return [[obj1 date] compare:[obj2 date]];
}
Displaying in table. If you have different types of cell for your entities:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
id ent = [dataArray objectAtIndex:indexPath.row];
UITableViewCell* cell = nil;
if ([ent isKindOfClass:[Entity1 class]]){
// create and/or setup cell for entity1
}
if ([ent isKindOfClass:[Entity2 class]]){
// create and/or setup cell for entity2
}
return cell;
}