8

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 ?

gfekri
  • 818
  • 8
  • 9
  • same here. i believe this is a bug. – alioguzhan Jan 06 '15 at 02:53
  • maybe try priority background? This warning is due of some code running on the main thread when it shouldn't, and therefore blocking the UI. If you're 100% sure it happens here and not somewhere else, try that. Otherwise I don't know, it all looks fine. On the other hand, Parse explicity said in an answer somewhere that these warnings are just warnings, and if your app runs smoothly anyway, you can safely ignore them. – Gil Sand Jan 08 '15 at 12:48
  • Thanks for your Suggestion, i have tried to change the priority to background and it still have the same warning. Regarding to make sure that 100% this line is the reason yes i have comment and uncomment the line to make sure and also i do a print line just before and after, also i add a breakpoint on that line, So i'm sure that this is the cause of this warning. i read about to ignore the error, however i would prefer if i can avoid it - it will be better. Thanks – gfekri Jan 09 '15 at 01:16

1 Answers1

2

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

amudi
  • 136
  • 5
  • 2
    The bug is not fixed yet with Parse SDK 1.6.2. I still have it with `Parse.enableLocalDatastore + Parse.setApplicationId + PFFacebookUtils.initializeFacebook` (or Twitter equivalent) – Kalzem Jan 27 '15 at 14:18