Is there any real difference between:
id value;
BOOL compare1 = [value isMemberOfClass:[SomeClass class]];
BOOL compare2 = [value class] == [SomeClass class];
to check if value
is a SomeClass
object?
Is there any real difference between:
id value;
BOOL compare1 = [value isMemberOfClass:[SomeClass class]];
BOOL compare2 = [value class] == [SomeClass class];
to check if value
is a SomeClass
object?
If value
is an NSProxy
, isMemberOfClass:
will properly check the proxied object, the other construct, I believe, won't (I think it will clumsily duplicate isProxy:
).