本文介绍了PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)提供编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Facebook登录信息集成到我的解析应用程序中.我遵循了解析教程中提到的每个步骤.在下面的代码中,出现编译错误.

I'm trying to integrate facebook login in my parse application. I followed every step mentioned in parse tutorial. In the below code, I'm getting compilation error.

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    line1: Parse.setApplicationId("xxx", clientKey: "yyy")
    line2: PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)       
    line3: PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
    line4: return true
}

第3行中,我收到了错误消息:

In line 3, I'm getting error:

如果我使用'!'手动解开包装,因为launchOptions可以为nil,我得到:

If I manually unwrap it using '!', because launchOptions can be nil, I get:

如果我检查是否为零,我得到:

If I check for nil, I get:

有什么想法要解决吗?

推荐答案

这是ParseSDK中的错误.在解析此问题之前,您可以在PFFacebookUtils.h头文件中更改初始化函数声明

It is a bug in ParseSDK. Until Parse fix this you can change the initialize function declaration at PFFacebookUtils.h header file

1)转到PFFacebookUtils.h

1) Go to PFFacebookUtils.h

2)更改:

  • (void)初始化FacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions;

收件人:

  • (void)初始化FacebookWithApplicationLaunchOptions:(PF_NULLABLE NSDictionary *)launchOptions;

此答案由Kiarash Akhlaghi在 https://developers.facebook.com/bugs/1462780714012820/提供

This answer was provided by Kiarash Akhlaghi at https://developers.facebook.com/bugs/1462780714012820/

这篇关于PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)提供编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 19:02