Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse.enableLocalDatastore() - Warning: A long-running operation is being executed on the main thread

Also i have executed the Parse.enableLocalDatastore() in dispatch_async - i'm still have the warning.

Even when i add a symbolic breakpoint on warnParseOperationOnMainThread it dosen't break

here is the code Snippet from the 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
    }  

Request

Appreciate if someone highlight to me, What is missing to avoid this warning message ?

like image 996
gfekri Avatar asked Dec 30 '14 11:12

gfekri


1 Answers

It is a bug and it will be fixed in the next Parse SDK release https://developers.facebook.com/bugs/1537241009878763/

like image 140
amudi Avatar answered Sep 28 '22 01:09

amudi