取消延时功能

- (void) networkReachabilityDidUpdate:(NetworkReachability*)reachability

{

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

    

    [self performSelector:@selector(reachabilityChanged) withObject:nil afterDelay:0.1f];

}

//cancelPreviousPerformRequestsWithTarget终止最后performSelector的Delay转让

//上面的例子是防止afterDelay重复调用时间reachabilityChanged

posted @ 2015-12-15 15:39  yxwkaifa  阅读(217)  评论(0编辑  收藏  举报