简体   繁体   English

解析和Facebook-PFUser logInWithAuthType无法识别的选择器错误

[英]Parse and Facebook - PFUser logInWithAuthType unrecognized selector error

I am having an issue using Parse to authenticate with Facebook. 我在使用Parse向Facebook进行身份验证时遇到问题。 My app will run fine until I hit the login to facebook button, and the below error is thrown: 我的应用程序将正常运行,直到我单击“登录Facebook”按钮,并引发以下错误:

2014-10-21 12:42:20.047 beacon-iphone[35352:15965138] +[PFUser logInWithAuthType:block:]: unrecognized selector sent to class 0x1101f0640
2014-10-21 12:42:20.050 beacon-iphone[35352:15965138] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[PFUser logInWithAuthType:block:]: unrecognized selector sent to class 0x1101f0640'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000011349e3f5 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000113137bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x00000001134a540d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00000001133fd7fc ___forwarding___ + 988
    4   CoreFoundation                      0x00000001133fd398 _CF_forwarding_prep_0 + 120
    5   beacon-iphone                       0x000000010ff4752e +[PFFacebookUtils logInWithPermissions:block:] + 159
    6   beacon-iphone                       0x000000010fd39374 -[ViewController loginButtonTouchHandler:] + 228
    7   UIKit                               0x00000001119f69ee -[UIApplication sendAction:to:from:forEvent:] + 75
    8   UIKit                               0x0000000111afcbd0 -[UIControl _sendActionsForEvents:withEvent:] + 467
    9   UIKit                               0x0000000111afbf9f -[UIControl touchesEnded:withEvent:] + 522
    10  UIKit                               0x0000000111a3c3b8 -[UIWindow _sendTouchesForEvent:] + 735
    11  UIKit                               0x0000000111a3cce3 -[UIWindow sendEvent:] + 683
    12  UIKit                               0x0000000111a09ae1 -[UIApplication sendEvent:] + 246
    13  UIKit                               0x0000000111a16bad _UIApplicationHandleEventFromQueueEvent + 17370
    14  UIKit                               0x00000001119f2233 _UIApplicationHandleEventQueue + 1961
    15  CoreFoundation                      0x00000001133d3ad1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    16  CoreFoundation                      0x00000001133c999d __CFRunLoopDoSources0 + 269
    17  CoreFoundation                      0x00000001133c8fd4 __CFRunLoopRun + 868
    18  CoreFoundation                      0x00000001133c8a06 CFRunLoopRunSpecific + 470
    19  GraphicsServices                    0x00000001143219f0 GSEventRunModal + 161
    20  UIKit                               0x00000001119f5550 UIApplicationMain + 1282
    21  beacon-iphone                       0x000000010fd3af63 main + 115
    22  libdyld.dylib                       0x00000001139ca145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

After reading the message, it looks like the error is coming from the PFFacebookUtils loginWithPermissions method: 阅读该消息后,该错误似乎来自PFFacebookUtils loginWithPermissions方法:

- (IBAction)loginButtonTouchHandler:(id)sender {
    // Set permissions required from the facebook user account
    NSArray *permissionsArray = @[ @"user_about_me", @"user_relationships", @"user_birthday", @"user_location"];

    // Login PFUser using Facebook
    [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {

        if (!user) {
            NSString *errorMessage = nil;
            if (!error) {
                NSLog(@"Uh oh. The user cancelled the Facebook login.");
                errorMessage = @"Uh oh. The user cancelled the Facebook login.";
            } else {
                NSLog(@"Uh oh. An error occurred: %@", error);
                errorMessage = [error localizedDescription];
            }
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Log In Error"
                                                            message:errorMessage
                                                           delegate:nil
                                                  cancelButtonTitle:nil
                                                  otherButtonTitles:@"Dismiss", nil];
            [alert show];
        } else {
            if (user.isNew) {
                NSLog(@"User with facebook signed up and logged in!");
            } else {
                NSLog(@"User with facebook logged in!");
            }
        }
    }];
}

However, this is a vanilla login as documented by Parse. 但是,这是Parse记录的原始登录信息。 Any suggestions? 有什么建议么?

Update After analyzing this further, I am noticing that this error only occurs when Parse is upgraded from 1.4.1 to 1.4.2 更新在进一步分析之后,我注意到此错误仅在Parse从1.4.1升级到1.4.2

You must be using Parse 1.4.2 with ParseFacebookUtils 1.4.1. 您必须将Parse 1.4.2与ParseFacebookUtils 1.4.1一起使用。 Do a pod update and it will update your ParseFacebookUtils to 1.4.2. 进行pod update ,它将您的ParseFacebookUtils更新为1.4.2。

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

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