iOS中延時執行(睡眠)的幾種方法

1. 最直接的方法: spa [self performSelector:@selector(deleyMethod) withObject:nil afterDelay:1.0]; 此方式要求必須在主線程中執行,不然無效。是一種非阻塞的執行方式,暫時未找到取消執行的方法。 缺點:每次要爲延時寫一個方法。線程 2. 用 NSTreadcode [NSThread sleepForTimeInter
相關文章
相關標籤/搜索