-3

I am using tableview and I want to call a method after some time duration.This method return a array and reload the tableview.I want within this time duration UI doesn't stuck.

Suyash Seth
  • 85
  • 1
  • 10

1 Answers1

0

Best to use Grand Central Dispatch (GCD). If you call dispatch_after(), you can run a block of code whenever you want.

// Run this code after 1 second.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [self someMethod];
});
colinbrash
  • 481
  • 2
  • 11