延遲執行方法

- (void)delayMethod { NSLog(@"execute"); } 1.performSelector方法 [self performSelector:@selector(delayMethod) withObject:nil afterDelay:1.0f]; 此方式要求必須在主線程中執行,不然無效。 是一種非阻塞的執行方式, 暫時未找到取消執行的方法。 2.定時器:N
相關文章
相關標籤/搜索