[self performselector: withObject: afterDelay:];一定时间后执行某个方法

{
    NSLog(@"111");

      SEL rl = @selector(rotateLayers);

      [selfperformSelector:rl withObject:nilafterDelay:1.0]; // 这里不延时1秒

      NSLog(@"222");

}

- (void)rotateLayers {
    NSLog(@"333");
}

结果:

19:47:55.326 CA Demos[5138:907] 111

19:47:55.327 CA Demos[5138:907] 222

19:47:56.329 CA Demos[5138:907] 333

原文地址:https://www.cnblogs.com/sell/p/2909383.html