簡體   English   中英

解析和Facebook-PFUser logInWithAuthType無法識別的選擇器錯誤

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

我在使用Parse向Facebook進行身份驗證時遇到問題。 我的應用程序將正常運行,直到我單擊“登錄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) 

閱讀該消息后,該錯誤似乎來自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!");
            }
        }
    }];
}

但是,這是Parse記錄的原始登錄信息。 有什么建議么?

更新在進一步分析之后,我注意到此錯誤僅在Parse從1.4.1升級到1.4.2

您必須將Parse 1.4.2與ParseFacebookUtils 1.4.1一起使用。 進行pod update ,它將您的ParseFacebookUtils更新為1.4.2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM