2016-03-18 11 views
0
**Getting this error in the logs:** 

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) 

また、私のコードのエラー取得:[PFUserAuthenticationController registerAuthenticationProviderは:]:認識されていないセレクタはインスタンスに送信0x7f96c1fa6090

スレッド1:信号SIGABRTが、私はまだ店ではありませんが私のコード。

AppDelegate.swiftで私のコード(個人情報は、 "XXX" に置き換え):助けてください

import UIKit 
import Parse 
import Bolts 

// If you want to use any of the UI components, uncomment this line 
// import ParseUI 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

    var window: UIWindow? 

    //-------------------------------------- 
    // MARK: - UIApplicationDelegate 
    //-------------------------------------- 

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 
     // Enable storing and querying data from Local Datastore. 
     // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. 
     Parse.enableLocalDatastore() 

     let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in 
      ParseMutableClientConfiguration.applicationId = "xxx" 
      ParseMutableClientConfiguration.clientKey = "xxx" 
      ParseMutableClientConfiguration.server = "https://yourapp.herokuapp.com/parse" 
     }) 

     Parse.initializeWithConfiguration(parseConfiguration) 


     PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) 

     PFUser.enableAutomaticUser() 

     let defaultACL = PFACL(); 

     // If you would like all objects to be private by default, remove this line. 
     defaultACL.publicReadAccess = true 

     PFACL.setDefaultACL(defaultACL, withAccessForCurrentUser:true) 

     if application.applicationState != UIApplicationState.Background { 
      // Track an app open here if we launch with a push, unless 
      // "content_available" was used to trigger a background push (introduced in iOS 7). 
      // In that case, we skip tracking here to avoid double counting the app-open. 

      let preBackgroundPush = !application.respondsToSelector("backgroundRefreshStatus") 
      let oldPushHandlerOnly = !self.respondsToSelector("application:didReceiveRemoteNotification:fetchCompletionHandler:") 
      var noPushPayload = false; 
      if let options = launchOptions { 
       noPushPayload = options[UIApplicationLaunchOptionsRemoteNotificationKey] != nil; 
      } 
     if (preBackgroundPush || oldPushHandlerOnly || noPushPayload) { 
       PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions) 
      } 
    } 
    if application.respondsToSelector("registerUserNotificationSettings:") { 
      let userNotificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound] 
     let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil) 
     application.registerUserNotificationSettings(settings) 
     application.registerForRemoteNotifications() 
    } else { 
      let types: UIRemoteNotificationType = [UIRemoteNotificationType.Badge, UIRemoteNotificationType.Alert, UIRemoteNotificationType.Sound] 
     application.registerForRemoteNotificationTypes(types) 
     } 

     return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 
    } 

    //-------------------------------------- 
    // MARK: Push Notifications 
    //-------------------------------------- 

    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { 
     let installation = PFInstallation.currentInstallation() 
     installation.setDeviceTokenFromData(deviceToken) 
     installation.saveInBackground() 

     //  PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in 
     //   if succeeded { 
     //    print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel."); 
     //   } else { 
     //    print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.", error) 
     //   } 
     //  } 
    } 

    func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) { 
     if error.code == 3010 { 
      print("Push notifications are not supported in the iOS Simulator.") 
     } else { 
      print("application:didFailToRegisterForRemoteNotificationsWithError: %@", error) 
     } 
    } 

    func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { 
     PFPush.handlePush(userInfo) 
     if application.applicationState == UIApplicationState.Inactive { 
      PFAnalytics.trackAppOpenedWithRemoteNotificationPayload(userInfo) 
     } 
    } 

    func application(application: UIApplication, 
     openURL url: NSURL, 
     sourceApplication: String?, 
     annotation: AnyObject) -> Bool { 
      return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) 
    } 

    func applicationDidBecomeActive(application: UIApplication) { 
     FBSDKAppEvents.activateApp() 
    } 


} 

は、

+0

のThe Tinderアプリを作る? – CQM

+0

はい火口クローンコースを通して – LizG

+1

ParseとFacebookの最新のライブラリを使用していることを確認してください。古い命令の依存関係をコピーした場合、古いバージョンである可能性があります。 「認識されていない選択」とは、通常、必要なクラスあなたのviewcontrollerにあることは追加されていません – CQM

答えて

0

私は、次の操作を行って、このエラーを修正するために管理:

まず私が(代わりにロブのバージョンの)解析サーバの正式版を導入しました。このリンクを開き、[Deploy to Heroku]をクリックし、手順に従います。 https://github.com/ParsePlatform/parse-server-example

その後、私は下のリンクからParse Framework(Facebookフレームワークを含む)をダウンロードし、ダウンロードしたこれらのフレームワークでプロジェクトの現在のフレームワークをすべて置き換えました。 https://parse.com/downloads/ios/parse-library/latest

それ以外

ちょうど電子など、AppDelegateにコードを追加する(Info.pslistをクラスの手順に従ってください

すべての問題は、私に知らせてください。

+0

ありがとう@Rafael http://www.robpercival.coにあるParse-Starter-Projectを使用しましたか?uk/parse-working-on-xcode-7swift-2 /? – LizG

+0

私はあなたが提案したとおり、以下のエラーで立ち往生しました:-canOpenURL:URL: "fbauth2:/" - エラー: "(null)"のログに失敗しました。 developers.facebook.comでアプリを再作成し、plist情報をコピーしてplistに貼り付けたままでこのエラーが発生しました – LizG

+0

CFBundleURLSchemesの後に fbauth2を追加してこのエラーを修正しました。あなたの助けをありがとう – LizG

0

チェックこのリンクをありがとう:Parse - Facebook SDK Exception

私は思います問題はこのコード行にあります。

PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) 

最新のFacebookとParseのバージョンを使用しています。しかし、最新のバージョンが参照されていることは確かですか? (たぶんpodspecs、またはpodfile)。

この種のエラーは、メソッドクラスを参照するnilオブジェクトによるものです。これも起こっているかどうかを確認してください。

+0

返信ありがとうございます@Sophy - 私はPFFacebookUtils.hのV4を参照していますが、運はありません – LizG

+0

すべてに入り、 fbとsdksを解析するが、新しいエラーが発生する:FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:]:インスタンスに送信された認識できないセレクタ0x7fed38d61290 – LizG

関連する問題