延时加载两种方式

   
   
//  1. 延迟执行
    
    
//  方式一: 多少秒之后 调用self的Selector方法stand, 传递withObject这个参数.
    [self performSelector:@selector(stand) withObject:nil afterDelay:self.containerView.animationDuration];
    
    
//   方式二:
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // 2.0秒后执行block里面的代码
        
    });
    
    
    
    
    

 

posted @ 2015-07-14 00:16  J了个P  阅读(150)  评论(0编辑  收藏  举报