first we need about the diffrenciation between iskindofClass and isMemberOfClass
isKindOfClass
Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
YES if the receiver is an instance of aClass or an instance of any class that inherits from aClass, otherwise NO.
isMemberOfClass
Returns a Boolean value that indicates whether the receiver is an instance of a given class.
YES if the receiver is an instance of aClass, otherwise NO.
Then very importantly
NSValue
An NSValue object is a simple container for a single C or Objective-C data item. It can hold any of the scalar types such as int, float, and char, as well as pointers, structures, and object id references. Use this class to work with such data types in collections (such as NSArray and NSSet), key-value coding, and other APIs that require Objective-C objects. NSValue objects are always immutable.
NSNumber
NSNumber is a subclass of NSValue that offers a value as any C scalar (numeric) type. It defines a set of methods specifically for setting and accessing the value as a signed or unsigned char, short int, int, long int, long long int, float, or double or as a BOOL. (Note that number objects do not necessarily preserve the type they are created with.) It also defines a compare: method to determine the ordering of two NSNumber objects
if ([value isKindOfClass:[NSValue class]]) //It will return YES because NSNumber value subclass or inherits from NSValue
{
..........
}
if ([value isMemberOfClass:[NSValue class]]) //It will return NO because NSNumber value is not a member of the NSValue
{
.........
}
Class objects may be compiler-created objects but they still support the concept of membership. Thus, you can use this method to verify that the receiver is a specific Class object.