Objective c protocol generics

mllm picture mllm · Feb 3, 2016 · Viewed 8.1k times · Source

Can Objective-C protocol be generic?

Following this tutorial, I'm basically looking for something like that:

@protocol ItemsStore<__covariant ObjectType> <NSObject>

-(NSArray <ObjectType> *)items;

@end

Which is a generic protocol for some ObjectType that "implements" ("inherits") another protocol NSObject

Answer

mllm picture mllm · Jul 11, 2016

As @rmaddy suggested, and as referred to this questions, it is NOT possible. Shame, moving to Swift then...