解析facebook崩溃目标c

时间:2016-04-05 05:26:29

标签: ios objective-c facebook

我正在尝试让我的应用程序登录Facebook,但它仍然从解析和Facebook开发人员guild崩溃。这是我的代码。

-(IBAction)LoginWithFacebook {
    // Set permissions required from the facebook user account
    NSArray *permissionsArray = @[@"email", @"password", @"user_about_me", @"user_birthday", @"user_location"];

    [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
        if (!user) {
            NSLog(@"Uh oh. The user cancelled the Facebook login.");
        } else if (user.isNew) {
            NSLog(@"User signed up and logged in through Facebook!");
        } else {
            NSLog(@"User logged in through Facebook!");
        }
    }];



   }

这是崩溃时收到的错误消息。它很长,我不知道这一切意味着什么,我不确定这是否有用。

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSProxy doesNotRecognizeSelector:openWithBehavior:fromViewController:completionHandler:] called!'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000011301ed85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001129c4deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000011301ecbd +[NSException raise:format:] + 205
    3   CoreFoundation                      0x0000000112f6dcfa ___forwarding___ + 970
    4   CoreFoundation                      0x0000000112f6d8a8 _CF_forwarding_prep_0 + 120
    5   RestaurentApp                       0x000000010f136b13 -[PFFacebookAuthenticationProvider authenticateAsync] + 627
    6   RestaurentApp                       0x000000010f133ffb +[PFFacebookUtils logInWithPermissionsInBackground:] + 122
    7   RestaurentApp                       0x000000010f134103 +[PFFacebookUtils logInWithPermissions:block:] + 71
    8   RestaurentApp                       0x000000010f0fcf90 -[LoginWithVC LoginWithFacebook] + 176
    9   UIKit                               0x0000000110fd8a8d -[UIApplication sendAction:to:from:forEvent:] + 92
    10  UIKit                               0x000000011114be67 -[UIControl sendAction:to:forEvent:] + 67
    11  UIKit                               0x000000011114c143 -[UIControl _sendActionsForEvents:withEvent:] + 327
    12  UIKit                               0x000000011114b263 -[UIControl touchesEnded:withEvent:] + 601
    13  UIKit                               0x000000011104b99f -[UIWindow _sendTouchesForEvent:] + 835
    14  UIKit                               0x000000011104c6d4 -[UIWindow sendEvent:] + 865
    15  UIKit                               0x0000000110ff7dc6 -[UIApplication sendEvent:] + 263
    16  UIKit                               0x0000000110fd1553 _UIApplicationHandleEventQueue + 6660
    17  CoreFoundation                      0x0000000112f44301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    18  CoreFoundation                      0x0000000112f3a22c __CFRunLoopDoSources0 + 556
    19  CoreFoundation                      0x0000000112f396e3 __CFRunLoopRun + 867
    20  CoreFoundation                      0x0000000112f390f8 CFRunLoopRunSpecific + 488
    21  GraphicsServices                    0x0000000114282ad2 GSEventRunModal + 161
    22  UIKit                               0x0000000110fd6f09 UIApplicationMain + 171
    23  RestaurentApp                       0x000000010f122aaf main + 111
    24  libdyld.dylib                       0x000000011374e92d start + 1
    25  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

1 个答案:

答案 0 :(得分:0)

也许问题是你使用的图书馆太旧了,我遇到了同样的问题。

这是两个主要步骤:

  1. 使用 ParseFacebookUtilsV4.framework 代替 ParseFacebookUtils.framework
  2. logInWithPermissions 方法更改为 logInInBackgroundWithReadPermissions