I've got a method that will sync my app with the online API. When running this sync script the reponses of the app are delayed. I tried using:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
self.syncEverything()
}
This doesn't has any effect on the speed. Could someone tell me the right approach for this problem?
EDIT
I changed the code, my syncing script is now using a different context then the context of the main thread. When the syncing is complete, I merge the contexts. Still the syncing is slowing down the gui.
Below my CPU activity when syncing, does this mean everything is running on the main thread?
In some of the classes used in "syncEverything()" is UIKit imported, could this be the cause of the delay?