inheritance - Casting a class type as its known super class in Objective-C -


i have parent class in use class variable known super class. there way tell compiler super class of type?

my use case more complex using external library (which why have such strange thing. here simplified:

@interface  +(void)magicmethod; @end   #import "a.h" @interface b:  @end   #import "a.h" @interface c {     class class_to_call }  @implementation c -(void) fun_method {    [class_to_call magicmethod];  // need context here base class a!!!! } @end     #import "c.h" @interface d: c @end  @implementation d -(id)init {    self = [super init];    class_to_call = [b class]; } 

as can see above, there no way give context class i'm using call. there syntax "class" variable holds class base type a?


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -