Cocos2d iphone 如何删除计时器
我有这个计时器Cocos2d iphone 如何删除计时器,cocos2d-iphone,Cocos2d Iphone,我有这个计时器 [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateTimerFunc) userInfo:nil repeats:YES]; 对于某些函数,我想完全删除它…如何?您不应该在Cocos2d中使用NSTimer,而是应该: [self schedule:@selector(updateTimerFunc) interval:1.0]; 并将其删除: [self unsc
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateTimerFunc) userInfo:nil repeats:YES];
对于某些函数,我想完全删除它…如何?您不应该在Cocos2d中使用NSTimer,而是应该:
[self schedule:@selector(updateTimerFunc) interval:1.0];
并将其删除:
[self unschedule:@selector(updateTimerFunc)];
或:
如果您有更新功能,可以使用:
[self scheduleUpdate]代码>您不应在Cocos2d中使用NSTimer,而应执行以下操作:
[self schedule:@selector(updateTimerFunc) interval:1.0];
并将其删除:
[self unschedule:@selector(updateTimerFunc)];
或:
如果您有更新功能,可以使用:[self scheduleUpdate]代码>