I am trying to implement a data source that can be used to configure several different cell classes to represent a table, but I am having problems with a common type in the block that I pass to the constructor.
Here is the implementation of the data source header file:
@interface ABParseDatasource<__covariant ObjectType: UITableViewCell *> : NSObject <UITableViewDataSource>
- (instancetype)initWithCellIdentifier:(NSString *)identifier parseQuery:(PFQuery *)query tableView:(UITableView *)tableView customizeBlock:(void (^)(ObjectType))customBlock;
@end
And this is where I try to initialize the block in the constructor:
self.parseDatasource = [[ABParseDatasource alloc] initWithCellIdentifier:identifier parseQuery:[ABOrder query] tableView:self.tableView customizeBlock:^(ABOrderItemTableViewCell *cell) {
}];
Property Declaration:
@property (nonatomic) ABParseDatasource<ABOrderItemTableViewCell *> *parseDatasource;
But I get a compiler error when instantiating the data source:

Any ideas? (And yes ABOrderItemTableViewCellinherit from UITableViewCell)
source
share