objective c - How to get Class object without instance? -


is there way result of:

    nsobject *a = [[nsobject alloc] init];     [a class]; 

without instantiating? wish pass class object function argument, , check then. this:

    - (void) pushcontrollerofclass: (class) aclass     {         if([aclass issubclassofclass: *what should write here?*]) {         ...         }     } 

intuitively, i've tried write

        if([aclass issubclassofclass: uiviewcontroller]) { 

but doesn't work. thx future response.

update: such function considered bad in objectivec? i've refactored code nahavandipoor's book ios 5 programming cookbook. that:

- (void) pushsecondcontroller{     secondviewcontroller *secondcontroller = [[secondviewcontroller alloc]                                              initwithnibname:nil                                               bundle:null];     [self.navigationcontroller pushviewcontroller:secondcontroller animated:yes]; } 

as me, kind of bad function: doesn't parametrized when should be.

try with:

 if([aclass issubclassofclass:[uiviewcontroller class]]) 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -