I'm trying to use a class as a key in an NSDictionary
. I looked at the answer to this question and what I have is pretty much the same; I'm using setObject: forKey:
. However, XCode complains, saying Incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>'
. The call I have is:
[_bugTypeToSerializerDictionary setObject: bugToStringSerializer
forKey: [bugToStringSerializer serializedObjectType]];
bugToStringSerializer
is an instance of BugToStringSerializer
whose concrete implementations implement serializedObjectType
. An example of a concrete implementation looks like this:
- (Class) serializedObjectType {
return [InfectableBug class];
}
What am I doing wrong here?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With