解析v1.7.4和Facebook SDK NSInvalidArgumentException',原因:'+ [NSData PF_dataFromBase64String:]:无法识别的选择器已发送给类 [英] Parse v1.7.4 and Facebook SDK NSInvalidArgumentException', reason: '+[NSData PF_dataFromBase64String:]: unrecognized selector sent to class

查看:107
本文介绍了解析v1.7.4和Facebook SDK NSInvalidArgumentException',原因:'+ [NSData PF_dataFromBase64String:]:无法识别的选择器已发送给类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将FB和Parse SDK都升级到最新版本后,出现此错误.我知道这会在下面的方法中在我的应用程序委托中发生.

I get this error, after upgrading both the FB and Parse SDK to the latest versions. I know that this occurs in my app delegate in the method below.

我有一个混合的swift和客观的c应用程序,我的委托是用Objective C编写的,而在我开发下一个版本时,我正在Swift中转换和编写新的类.如果我注释掉下面的处理程序,则不会发生该错误,但是会收到登录失败消息,这是我期望的.按下登录按钮后,将显示授权应用程序的Facebook页面,然后返回到视图控制器,此时,下面的方法完成时将发生错误.

I have a mixed swift and objective c application, my delegate is written in Objective C and as I am working to the next version I am converting and writing new classes in Swift. If I comment out the handler below the error does not occur, but i get a login failed message, which is what i would expect. After pressing in the login button the Facebook page to authorise the app appears and then the returns to the view controller it is at this point when the method below completes that the error happens.

我理解此错误的含义,因为在没有选择器的类上调用了选择器.我遇到的问题是,我已经检查了所有框架是否都存在,并且此调用似乎是在PARSE或Facebook SDK中进行的,因此我看不到如何解决此问题.谁能帮忙解决此呼叫失败的原因.

I understand the meaning of this error, in that a selector is being called on a class that does not have it. The issue I have is that I have checked that all the frameworks are present, and this call appears to be happening from within either the PARSE or Facebook SDKs, so I can't see how to rectify this. can anyone help in why this call fails.

非常感谢.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    NSLog(@"-------------------------end.of.application.FBSDKApplicationDelegate");


    NSLog(@"facebook.Response=%@,url =%@,sourceApp= %@,annotation =%@",application,url,sourceApplication,annotation);


   return  [[FBSDKApplicationDelegate sharedInstance] application:application
                                                           openURL:url
                                                 sourceApplication:sourceApplication
                                                        annotation:annotation];








   // return true;

}




Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData PF_dataFromBase64String:]: unrecognized selector sent to class 0x11343ca48'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000113193c65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000112e2cbb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000011319afad +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00000001130f113c ___forwarding___ + 988
    4   CoreFoundation                      0x00000001130f0cd8 _CF_forwarding_prep_0 + 120
    5   Chored                              0x000000010e2badf5 -[PFDecoder decodeDictionary:] + 658
    6   Chored                              0x000000010e2bb545 -[PFDecoder decodeObject:] + 130
    7   Chored                              0x000000010e2bb1b8 __30-[PFDecoder decodeDictionary:]_block_invoke + 94
    8   CoreFoundation                      0x0000000113192fbc ____NSDictionaryEnumerate_block_invoke421 + 28
    9   CoreFoundation                      0x0000000113092400 CFBasicHashApply + 128
    10  CoreFoundation                      0x00000001130cb85b __NSDictionaryEnumerate + 619
    11  Chored                              0x000000010e2bad5c -[PFDecoder decodeDictionary:] + 505
    12  Chored                              0x000000010e2bb545 -[PFDecoder decodeObject:] + 130
    13  Chored                              0x000000010e259631 -[PFCommandNetworkOperation _operationDidFinish] + 259
    14  CFNetwork                           0x000000011100c0bc __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
    15  CFNetwork                           0x000000011100c060 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
    16  CFNetwork                           0x000000011100c1c7 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
    17  CFNetwork                           0x0000000110edb757 ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
    18  CFNetwork                           0x0000000110fa8de1 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
    19  CFNetwork                           0x0000000110ec6a26 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 72
    20  CoreFoundation                      0x000000011309a354 CFArrayApplyFunction + 68
    21  CFNetwork                           0x0000000110ec68e7 _ZN19RunloopBlockContext7performEv + 133
    22  CFNetwork                           0x0000000110ec6726 _ZN17MultiplexerSource7performEv + 256
    23  CFNetwork                           0x0000000110ec653c _ZN17MultiplexerSource8_performEPv + 72
    24  CoreFoundation                      0x00000001130c7431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    25  CoreFoundation                      0x00000001130bd2fd __CFRunLoopDoSources0 + 269
    26  CoreFoundation                      0x00000001130bc934 __CFRunLoopRun + 868
    27  CoreFoundation                      0x00000001130bc366 CFRunLoopRunSpecific + 470
    28  CoreFoundation                      0x000000011316a661 CFRunLoopRun + 97
    29  Foundation                          0x0000000112988383 __NSOQSchedule_f + 184
    30  libdispatch.dylib                   0x00000001141f2614 _dispatch_client_callout + 8
    31  libdispatch.dylib                   0x00000001141d96a7 _dispatch_queue_drain + 2176
    32  libdispatch.dylib                   0x00000001141d8cc0 _dispatch_queue_invoke + 235
    33  libdispatch.dylib                   0x00000001141dc3b9 _dispatch_root_queue_drain + 1359
    34  libdispatch.dylib                   0x00000001141ddb17 _dispatch_worker_thread3 + 111
    35  libsystem_pthread.dylib             0x000000011455f637 _pthread_wqthread + 729
    36  libsystem_pthread.dylib             0x000000011455d40d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

推荐答案

问题不是您的.它是由1.7.4版创建的.我也面对过.此临时修复是NSData上的一个类别,该类别提供了缺少的选择器.这是标题NSData+PFData.h:

The problem isn't yours. It was created by version 1.7.4. I faced it too. This temporary fix is a category on NSData that provides the missing selectors. Here it is a header, NSData+PFData.h:

@import Foundation;

@interface NSData (PFData)
+ (NSData *) PF_dataFromBase64String: (NSString *) base64;
- (NSString *) PF_base64EncodedString;
@end

实施NSData+PFData.m:

#import "NSData+PFData.h"

@implementation NSData (PFData)

+ (NSData *) PF_dataFromBase64String: (NSString *) base64 {
    return [NSData.alloc initWithBase64EncodedString: base64 options: 0];
} // +PF_dataFromBase64String:

- (NSString *) PF_base64EncodedString {
    return [self base64EncodedStringWithOptions: 0];
} // -PF_base64EncodedString

@end

您应该计划在不再需要该类别时删除它,例如使用Parse v1.7.5.

You should plan on removing this category when it is no longer necessary, say with Parse v1.7.5.

这篇关于解析v1.7.4和Facebook SDK NSInvalidArgumentException',原因:'+ [NSData PF_dataFromBase64String:]:无法识别的选择器已发送给类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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