我做了个实验
@interface MTBaseListViewController <T> : UIViewController
- (void )requestWithBlock1:(void (^)(T data ))block;
- (void )requestWithBlock2:(void (^)(MTListPagingModel<T> *data ))block;
@end;
声明没有问题。
在使用时:
@interface MTTestViewController : MTBaseListViewController <MTTestModel *>
@end
@implementation MTTestViewController
- (void )requestWithBlock1:(void (^)(MTTestModel *data ))block {
}
- (void )requestWithBlock2:(void (^)(MTListPagingModel<MTTestModel *> *data ))block {
}
@end
都会提示 Conflicting parameter types in implementation ....
block 内的声明还是不支持泛型吗?
但是我看到NSArray<ObjectType> (NSExtendedArray )里的 enumerateObjectsUsingBlock 是支持的
