Parse.enableLocalDatastore() - 警告:正在主线程上执行长时间运行的操作

时间:2014-12-30 11:27:42

标签: ios swift parse-platform local-datastore

我也在dispatch_async中执行了Parse.enableLocalDatastore() - 我仍然有警告。

即使我在warnParseOperationOnMainThread上添加一个符号断点,它也不会中断

这是来自app delegate

的代码片段
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.

        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
            Parse.enableLocalDatastore()

            Parse.setApplicationId("XXX", clientKey: "YYY")
            PFAnalytics.trackAppOpenedWithLaunchOptionsInBackground(launchOptions, block: nil )

            var defaultACL = PFACL()
            defaultACL.setPublicReadAccess(true)
            defaultACL.setPublicWriteAccess(false)
            PFACL.setDefaultACL(defaultACL, withAccessForCurrentUser:true)

            CAUser.registerSubclass()

            NSLog("App finish loading")

            dispatch_async(dispatch_get_main_queue()){
                () -> Void in
                // any UI updates need to happen in here back on the main thread
            }
        }

        return true
    }  

请求

感谢有人向我强调,为避免此警告消息缺少什么?

1 个答案:

答案 0 :(得分:2)

这是一个错误,它将在下一个Parse SDK版本https://developers.facebook.com/bugs/1537241009878763/

中修复