First of all, I know what this means. The problem is that I'm getting this error on standard calls that can't be converted to background calls. I'm getting this error on app start at:
[Parse enableLocalDatastore];
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
I've found out that these methods are causing the trouble by setting a symbolic breakpoint on warnParseOperationOnMainThread
and examining the call stack.
I can't replace these calls with async ones, and as far as I know, these methods are meant to be called regularly from the main thread. Is this a Parse bug, or should I call all these methods from a background thread?
Wrap the calls in...
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
dispatch_async(dispatch_get_main_queue(), ^(void){
// any UI updates need to happen in here back on the main thread
});
})
and you will no longer see the warnings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With