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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -