PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)提供编译错误 [英] PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) giving compilation error

查看:104
本文介绍了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:

可选类型'[NSObject:AnyObject]'的值未包装;你是否 是要使用"!"还是"?"?

Value of optional type '[NSObject:AnyObject]' not unwrapped; did you mean to use '!' or '?'?

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

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

致命错误:解开可选值时意外发现nil

Fatal error: unexpectedly found nil while unwrapping an Optional value

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

If I check for nil, I get:

NSInternalInconsistencyException',原因:您必须初始化 PFFacebookUtils致电 +initializeFacebookWithApplicationLaunchOptions

NSInternalInconsistencyException', reason: 'You must initialize PFFacebookUtils with a call to +initializeFacebookWithApplicationLaunchOptions

有什么想法要解决吗?

推荐答案

这是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)提供编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆