简体   繁体   English

解析和 Facebook SDK - 无法识别的选择器发送到类

[英]Parse and Facebook SDK - unrecognized selector sent to class

I'm currently using the latest Facebook SDK, Parse SDK and Xcode.我目前正在使用最新的 Facebook SDK、Parse SDK 和 Xcode。 The Parse SDK frameworks were copied to my project while the Facebook SDK frameworks were referenced. Parse SDK 框架被复制到我的项目中,而 Facebook SDK 框架被引用。 I'm using Bolts.framework that was provided by Facebook and I connected my Parse account with my Facebook App.我正在使用 Facebook 提供的 Bolts.framework 并将我的 Parse 帐户与我的 Facebook 应用程序连接起来。

The problem is when I try to implement Inside my AppDelegate.m file (after the Parse setApplicationId of course):问题是当我尝试在我的 AppDelegate.m 文件中实现时(当然是在 Parse setApplicationId 之后):

[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];

my app crashes with the following error:我的应用程序崩溃并出现以下错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class 0x102c060b0' *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“+[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]:无法识别的选择器发送到类 0x102c060b0”

These are the header files I included:这些是我包含的头文件:

#import <Parse/Parse.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

When I'm using the normal Facebook SDK alone it works fine - I can login using Facebook login button.当我单独使用普通的 Facebook SDK 时,它工作正常 - 我可以使用 Facebook 登录按钮登录。 When Parse comes into play with it's PFFacebookUtils class, I just had horrible experience.当 Parse 开始使用它的 PFFacebookUtils 类时,我只是有可怕的经历。 At first I couldn't even build the project because of linker errors which were fixed using this solution: https://stackoverflow.com/a/18626232/3608136起初,由于使用此解决方案修复的链接器错误,我什至无法构建项目: https : //stackoverflow.com/a/18626232/3608136

I've tried every solution in Stackoverflow, but I can't figure it out.我已经尝试了 Stackoverflow 中的所有解决方案,但我无法弄清楚。 Here is how my "Search Paths" look:这是我的“搜索路径”的外观:

$(inherited)
$(PROJECT_DIR)/parse-library-1
/Users/me/Documents/FacebookSDK

Everything related to Parse is in parse-library-1.与 Parse 相关的所有内容都在 parse-library-1 中。 By the way, needless to say.. when I try to user other methods like logInInBackgroundWithReadPermissions it crashes.顺便说一句,不用说......当我尝试使用其他方法时,比如 logInBackgroundWithReadPermissions 它崩溃了。

You can try to add "-ObjC" flag to Other Linker Flags section in project settings.您可以尝试将“-ObjC”标志添加到项目设置中的其他链接器标志部分。

Its happens to me with another framework and the solution was that!它发生在我身上,使用另一个框架,解决方案就是这样!

I hope it helps!我希望它有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM