美文网首页
NSRunLoopCommonModes

NSRunLoopCommonModes

作者: 啵啵_long_港 | 来源:发表于2019-01-08 16:11 被阅读8次

1、NSTimer需要设置为NSRunLoopCommonModes模式
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
2、延时方法需要设置NSRunLoopCommonModes模式
[self performSelector:@selector(method) withObject:nil afterDelay:5 inModes:@[NSRunLoopCommonModes]];
[NSObject cancelPreviousPerformRequestsWithTarget:self];

相关文章

网友评论

      本文标题:NSRunLoopCommonModes

      本文链接:https://www.haomeiwen.com/subject/ivhbrqtx.html