serverTimeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0target:self selector:@selector(refreshTimeLabel) userInfo:nilrepeats:YES]; [serverTimeTimer fire]; cocos2d-x 里面的貌似用一个schedule替代了 this->schedule(schedule_selector(testget::helle), 5.0f); void testget::helle(){ CCLog("定时器响应了"); this->unschedule(schedule_selector( testget::helle));//取消定时。与OC的[serverTimeTimer invalidate];功能 }