AppCode says "Casting to probably incompatible type" when I'm explicitly checking the type

60 Views Asked by At
for (NSPropertyDescription *property in [[self entity] properties]) {       
        if ([property isKindOfClass:NSAttributeDescription.class]) {
            NSAttributeDescription *attributeDescription = (NSAttributeDescription *)property;

AppCode is giving me the warning Casting to probably incompatible type on the last line of the code snippet above. Why?

I'm iterating over a list of NSPropertyDescription objects. NSAttributeDescription is a subclass of NSPropertyDescription. I check if the property isKindOfClass before casting it.

Is this just a bug in AppCode or does it know something I don't and warning me about a danger I'm not familiar with?

0

There are 0 best solutions below