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

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

即使我在warnParSEOperationOnMainThread上添加一个符号断点,它也不会破坏

这是应用程序委托的代码片段

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
    }

请求

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

解决方法

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...