If you have a class object is there a way to use it to call class methods of that class. For example, if you have class A with method + (void)foo defined how can you achieve something like the example below without the compiler warning that it can’t find the method foo:
A* object = [[A alloc] init];
id objectClass = [object class];
[objectClass foo]; // complains that the method is not found
Creating a class method in your .h:
MyClass.h
MyClass.m
You can then just call it like this:
Edit:
If the problem is the compiler warning, just create a @protocol that defines the foo method you want to call.
Instead of calling:
Try this;