What you are asking doesn't really make any sense.
unknownClass
points to a class object. Class
is just a type that can hold any pointer to a class object. You call a class method by sending a message to the class object.
Class
, like id
, turns off static type checking. That means the compiler won't complain that the object might not respond to the method. So you should just send a message to it. "Casting" doesn't make any sense. If you are getting en error that there is no interface that declares this method, then you got a completely unrelated problem that has nothing to do with types; instead the method is not declared in any visible header.
You say in comments to another answer that "I know that 'unknownClass' is in fact MyClass type." That makes your question make even less sense -- why not just use MyClass
directly then? instead of unknownClass
? Like [MyClass myMethod];