iphone - Reflection doesn't work for CCScene, why? -
i have sub-class of cclayer, named myscene. in app delegate added code:
-(void) applicationdidenterbackground:(uiapplication*)application { [[ccdirector shareddirector] stopanimation]; if( [[ccdirector shareddirector] runningscene] != nil ) { if( [[[ccdirector shareddirector] runningscene] iskindofclass:[myscene class]] ) { myscene *scene = (myscene*) [[ccdirector shareddirector] runningscene]; [scene goingtobackground]; } } }
the app has running scene, , know it's myscene, iskindofclass doesn't return yes. why?
[[ccdirector shareddirector] runningscene] returns ccscene not cclayer object. comparing ccscene cclayer sub class i.e. myscene return false. try set tag of myscene object , object tag , compare it. return yes
Comments
Post a Comment