iOS延时和取消延时

来源:互联网 发布:爱的算法 刘宇昆 编辑:程序博客网 时间:2024/05/16 07:40


多么痛的领悟………………


延时方法:

[self performSelector:@selector(timeOutHandleAction) withObject:nil afterDelay:10];

在10s内取消延时的方法:

[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(timeOutHandleAction) object:nil];


0 0
原创粉丝点击