如何获取没有实例的Class对象?

fol*_*lex 2 oop objective-c foundation nsobject ios

有没有办法得到结果:

    NSObject *a = [[NSObject alloc] init];
    [a class];
Run Code Online (Sandbox Code Playgroud)

没有实例化?我希望将Class对象作为参数传递,然后检查它.像这样:

    - (void) pushControllerOfClass: (Class) aClass
    {
        if([aClass isSubclassOfClass: *what should I write here?*]) {
        ...
        }
    }
Run Code Online (Sandbox Code Playgroud)

直觉上,我试着写

        if([aClass isSubclassOfClass: UIViewController]) {
Run Code Online (Sandbox Code Playgroud)

但它不起作用.感谢未来的回应.

更新: 在ObjectiveC中这样的功能是否被认为是错误的?我从Nahavandipoor的书" iOS 5 Programming Cookbook"中重构了代码.就像那样:

- (void) pushSecondController{
    SecondViewController *secondController = [[SecondViewController alloc]
                                             initWithNibName:nil 
                                             bundle:NULL];
    [self.navigationController pushViewController:secondController animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

至于我,这是一种不好的功能:它应该在没有参数的情况下进行参数化.

Mar*_*ace 8

试试:

 if([aClass isSubclassOfClass:[UIViewController class]])
Run Code Online (Sandbox Code Playgroud)