-2

In objective c ,i need get data from url in background (thread) with a period time.

¿ ideas ?

nsthread dispatch performSelectorInBackground

1 Answer 1

1

You could use GCD's dispatch_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.
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.