I have to define method which should be invoked periodically with some time interval. I need to invoke it in another thread (NOT main thread), because this method is used to get information from external API and sync data in core data.
How do I define this method to not block main thread?
Unless you have a specific need for timers, you can use Grand Central Dispatch.
The following snippet will execute a block after 2 seconds, on the default priority concurrent queue (i.e a background thread). You can change the priority of the queue if you see fit, but unless you're dealing with lots of different operations on concurrent queues, default will suffice.
If you're wanting to call this repeatedly, then you can use
dispatch_source_set_timer
to set a recurring execution. The jist of it is below: