What's the performance penalty of using isKindOfClass in Objective C?
- by durcicko
I'm considering introducing:
if ([myInstance isKindOfClass:[SomeClass class]]) { do something...}
into a piece of code that gets called pretty often. Will I introduce a significant performance penalty? In Objective C, is there a quicker way of assessing whether a given object instance is of certain class type? For example, is the following quicker? (I realize the test is somewhat different)
if (myInstance.class == [SomeClass class]) { do something else...}