可以当作要执行的函数名.
[self schedule:@selector(method:) interval:0.1];
-(void)method:(id)sender
{
[self unschedule:_cmd];
}
以上代码,本来每隔0.1秒后自动调用method,但是[self unschedule:_cmd];停止了该定时器,
结果是只调用了method一次,这样理解的话_cmd应该指的就是包含了代码[self unschedule:_cmd]
的函数method
http://www.cocoachina.com/bbs/read.php?tid-20797.html
本文介绍了一种在代码中使用[selfunschedule:_cmd]来取消定时器的方法,使得原本应每隔0.1秒调用一次的method仅执行一次。_cmd指向含有[selfunschedule:_cmd]的method函数。
1166

被折叠的 条评论
为什么被折叠?



