Iphone 在X时间内使用线程从url获取数据
在objective c中,我需要从背景(线程)中的url获取数据,并使用一段时间 什么主意 nsthread 派遣Iphone 在X时间内使用线程从url获取数据,iphone,objective-c,Iphone,Objective C,在objective c中,我需要从背景(线程)中的url获取数据,并使用一段时间 什么主意 nsthread 派遣 performSelectorInBackground您可以使用GCD的dispatch\u after() // Delay execution of my block for 2 seconds. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_global_que
performSelectorInBackground您可以使用GCD的
dispatch\u after()
// Delay execution of my block for 2 seconds.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Do whatever you want in the background here.
});