正常Parse函数上的主线程警告正在执行长时间运行的操作

Can*_*ğlu 14 ios parse-platform ios8 ios8.1

首先,我知道这意味着什么.问题是我在无法转换为后台调用的标准调用上遇到此错误.我在应用开始时收到此错误:

[Parse enableLocalDatastore];

PFInstallation *currentInstallation = [PFInstallation currentInstallation];

我发现这些方法通过设置符号断点warnParseOperationOnMainThread并检查调用堆栈而导致问题.

我不能用异步的调用替换这些调用,据我所知,这些方法从主线程定期调用的.这是一个Parse bug,还是应该从后台线程调用所有这些方法?

pds*_*pds 7

把电话换成......

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
        });
})
Run Code Online (Sandbox Code Playgroud)

你将不再看到警告.