Let's say I have a generic pointer in objective-c. This pointer could either be a Class
object, or it could be an instance of that class. Is there any way to tell the difference between the two?
Example:
id pointerA = [someClass class];
id pointerB = [[someClass alloc] init];
bool pointerAIsAClass = is_this_a_Class(pointerA); // should be true
bool pointerBIsAClass = is_this_a_Class(pointerB); // should be false
How would I write the
function so that it returns the proper is_this_a_Class
bool
value?
bool is_this_a_Class(id somePointer)
{
// your code goes here
}