objective c - Cocos2d update:(ccTime)dt giving screwed up values -
inside of class subclasses ccnode
, have scheduled -update:(cctime)dt
method. have bunch of behavior objects don't subclass ccnode
, have -update:(cctime)dt
method. here's inside of ccnode
's update
method:
-(void)update:(cctime)dt{ for(behavior *currentbehavior in behaviors){ [currentbehavior update:dt]; } }
when nslog
dt
value passed ccnode
's update
, prints out normal values (0.116699, 0.162726). however, when nslog
dt
value inside behaviors' update
methods, printed numbers of sudden screwed (0.000, 36893488147419103232, -2.000). it's strangest thing. when debug it, i'll see first dt
value normal, , i'll step inside behavior's update
, , value change crazy. what's going on?
i figured out. didn't have -update:(cctime)dt
in behavior class's .m file, , theory took complier time method selector, therefore screwed cctime.
Comments
Post a Comment