IsMemberOfClass versus comparing classes with ==

Is there any real difference between:

id value;
BOOL compare1 = [value isMemberOfClass:[SomeClass class]];
BOOL compare2 = [value class] == [SomeClass class];

to check if the valueobject is SomeClass?

+3
source share
1 answer

If it valueis NSProxy, it isMemberOfClass:will correctly check the proxy object, another design, I believe, will not (I think this is uncomfortable duplicates isProxy:).

+7
source

Source: https://habr.com/ru/post/1751946/


All Articles