Swift2 [PFUserAuthenticationController registerAuthenticationProvider:]:发送到实例0x7f96c1fa6090的选择器无法识别

Swift2 [PFUserAuthenticationController registerAuthenticationProvider:]:发送到实例0x7f96c1fa6090的选择器无法识别,swift2,ios9,xcode7,Swift2,Ios9,Xcode7,在日志中获取此错误: 2016-03-18 18:53:54.915 Tinder[715:229250] -[PFUserAuthenticationController registerAuthenticationProvider:]: unrecognized selector sent to instance 0x7f96c1fa6090 2016-03-18 18:53:54.919 Tinder[715:229250] *** Terminating app due to uncau

在日志中获取此错误:

2016-03-18 18:53:54.915 Tinder[715:229250] -[PFUserAuthenticationController registerAuthenticationProvider:]: unrecognized selector sent to instance 0x7f96c1fa6090
2016-03-18 18:53:54.919 Tinder[715:229250] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PFUserAuthenticationController registerAuthenticationProvider:]: unrecognized selector sent to instance 0x7f96c1fa6090'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000102e2ae65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000104f0fdeb objc_exception_throw + 48
    2   CoreFoundation                      0x0000000102e3348d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x0000000102d8090a ___forwarding___ + 970
    4   CoreFoundation                      0x0000000102d804b8 _CF_forwarding_prep_0 + 120
    5   Tinder                              0x000000010249506a +[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:] + 225
    6   Tinder                              0x00000001023b3ccd _TFC6Tinder11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb + 541
    7   Tinder                              0x00000001023b4a53 _TToFC6Tinder11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb + 179
    8   UIKit                               0x00000001039e31f1 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
    9   UIKit                               0x00000001039e4397 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
    10  UIKit                               0x00000001039eacc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
    11  UIKit                               0x00000001039e7e7b -[UIApplication workspaceDidEndTransaction:] + 188
    12  FrontBoardServices                  0x000000010657e754 -[FBSSerialQueue _performNext] + 192
    13  FrontBoardServices                  0x000000010657eac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    14  CoreFoundation                      0x0000000102d56a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    15  CoreFoundation                      0x0000000102d4c95c __CFRunLoopDoSources0 + 556
    16  CoreFoundation                      0x0000000102d4be13 __CFRunLoopRun + 867
    17  CoreFoundation                      0x0000000102d4b828 CFRunLoopRunSpecific + 488
    18  UIKit                               0x00000001039e77cd -[UIApplication _run] + 402
    19  UIKit                               0x00000001039ec610 UIApplicationMain + 171
    20  Tinder                              0x00000001023b57ad main + 109
    21  libdyld.dylib                       0x0000000105a5a92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

我的代码中还有一个错误:

线程1:信号SIGABRT

但我的代码中还没有任何出口

AppDelegate.swift中的我的代码(个人信息替换为“xxx”):

检查此链接:

我认为问题在于这一行代码:

PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
我看到你正在使用最新的Facebook和Parse版本。但您确定引用了最新版本吗?(可能在podspecs或podfile中)。尝试使用旧的good命令删除派生数据(cmd+shift+k和cmd+shift+alt+k)


此类错误是由于引用方法类的nil对象引起的。检查是否也发生了这种情况。

我通过以下操作修复了此错误:

首先,我部署了Parse Server的官方版本(而不是Rob的版本)。打开此链接并单击“部署到Heroku”,按照以下步骤操作。

之后,我从下面的链接下载了解析框架(包括Facebook框架),并用下载的框架替换了我项目中的所有当前框架。

除此之外,只需遵循类步骤(向AppDelegate、Info.pslist e等添加代码)


任何问题,请告诉我。

制作Tinder应用程序?是的,通过课程进行Tinder克隆。首先,确保您使用的是Parse和Facebook的最新库。如果您从旧指令复制依赖项,它们可能是旧版本。其次,查看网络,看看这些库是否支持,因为可能还有其他版本版本组合,以使其更好地工作。
未识别的选定
通常意味着没有添加需要在viewcontroller中的类。我正在使用Parse和Facebook中的所有最新库。我下载了最新的SDK。您的代码不包含对registerAuthenticationProvider的调用。您可以进行全局验证吗搜索查看它的调用位置?感谢@Sophy的回复-我正在引用PFFacebookUtils.h的V4,但没有运气通过进入并删除所有fb和解析SDK来修复此错误,但得到一个新错误:FBSDKLoginManager logInWithReadPermissions:fromViewController:handler::未识别的选择器发送到实例0x7fed38d61290 Hanks@Rafael Did yo您使用位于?的Parse Starter项目,我按照您的建议执行了此操作,现在遇到以下错误:-canOpenURL:URL失败:“fbauth2:/”-错误:“(null)”在我的日志中。我在developers.facebook.com中重新创建了应用程序,并将plist信息复制并粘贴到我的plist中,但仍然存在此错误。我通过在CbundleurlSchemes之后添加fbauth2修复了此错误。感谢您的帮助
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)