I am using XMPP for an iOS chat application. However, I have noticed that when the app processes the roster and the presence from the server the application's UI freezes momentarily and therefore the user cannot interact with it.
By default the xmppStream and xmppRoster modules are allocated in the main queue and so I tried to change that to a custom queue, but I get a run time error basically saying that I cannot use the NSManagedObject outside the main thread.
The roster in my app is fetched using an NSFetchedResults controller and so I also tried to put the fetch request on a background thread using GCD but still no difference. I don't really know what part of the code to post or what would be useful. Any suggestions on how to possibly fix that or pointers to tutorials would be extremely useful.
I have not managed to find the exact block of code that does the lengthy processing it might be delays from different part of the code as the app processes the roster and presence.