[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

posted @ 2013-02-08 19:52  diablo大王  阅读(2308)  评论(0编辑  收藏  举报