Pergunta

I have updated xcode and now I get the error message Incompatible pointer types sending 'Class' to parameter of type 'id'


- (void)mapObjectClass:(Class)objectClass toCellClass:(Class)cellClass {
  [self.objectToCellMap setObject:cellClass forKey:objectClass];
}

I would really appreciate it if someone can shed some light on this issue im having and how I can resolve it.

Foi útil?

Solução

Keys for an NSDictionary must be objects that adhere to the NSCopying protocol. Class doesn't qualify.

The first question is why are your method parameters of type Class and not something more typical such as a specific class type (object pointer) or id?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top