I am working on a application where the app fetches images from facebook. I am using core data to save the image. I use dispatch_asyc
function to save the image in the Core Data. I use
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)
to save the image so that my main thread doesn't block.
But some times I observed that app freezes and doesn't respond. I use the same way of saving image to core data at different places in the app, like if user goes to signed user profile, then app saves his album photos in the same way. Also if user goes to full screen of any image, it starts fetching of comments, likes and saves in the same way.
If I use a private queue and use the same for saving then app doesn't freeze.
Since I am using the global queue at many places in the app, is this the reason for freeze of the app?
Thanks.
This issue has been fixed. The issue was accessing of main context by multiple threads, because of this reason the app was going into freeze state. Now this issue has been fixed.