iphone - Inheritance in Objective C -
i have main game class renders game using open gl. thought inherit class , call [super init]
in init method copy of it. plan make modifications in copy seems doesn't work.
the following header file of class:
#import "gameview.h" @interface cloneview : gameview { } -(id)initwithframe:(cgrect)frame; @end
and clone view class:
@implementation cloneview -(id)initwithframe:(cgrect)frame{ return [super initwithframe:frame]; } @end
if set break point in init method in gameview class stops there. thing is: clone view doesn't rendered, screen stays black. missing? help!
edit record: tried without implementing initframe
, got same result. (as expected initframe
above isn't doing apart calling super)
edit 2 i'm adding clone view i'm creating 2 eagle contexts. reason why doesn't work?
if not adding in init
function of cloneview
don't have rewrite it. can have class inherit gameview
, automatically copies it's init
function.
Comments
Post a Comment